home.social

#sqlx — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #sqlx, aggregated by home.social.

  1. I use #sqlx, and I wanted syntax highlighting for embedded #SQL queries in my #Rust code. Making that work in #Neovim led me to learning a few things about #Treesitter, and #NixOS packaging conventions. Here's my write-up!

    Public replies to this post will appear in a comments section under the blog post.

    sitr.us/2026/05/03/embedded-sq

  2. I use #sqlx, and I wanted syntax highlighting for embedded #SQL queries in my #Rust code. Making that work in #Neovim led me to learning a few things about #Treesitter, and #NixOS packaging conventions. Here's my write-up!

    Public replies to this post will appear in a comments section under the blog post.

    sitr.us/2026/05/03/embedded-sq

  3. I use , and I wanted syntax highlighting for embedded queries in my code. Making that work in led me to learning a few things about , and packaging conventions. Here's my write-up!

    Public replies to this post will appear in a comments section under the blog post.

    sitr.us/2026/05/03/embedded-sq

  4. I use #sqlx, and I wanted syntax highlighting for embedded #SQL queries in my #Rust code. Making that work in #Neovim led me to learning a few things about #Treesitter, and #NixOS packaging conventions. Here's my write-up!

    Public replies to this post will appear in a comments section under the blog post.

    sitr.us/2026/05/03/embedded-sq

  5. I use #sqlx, and I wanted syntax highlighting for embedded #SQL queries in my #Rust code. Making that work in #Neovim led me to learning a few things about #Treesitter, and #NixOS packaging conventions. Here's my write-up!

    Public replies to this post will appear in a comments section under the blog post.

    sitr.us/2026/05/03/embedded-sq

  6. Модно не значит правильно — про pgx, метрики и OpenTelemetry

    Один вопрос про pgx — и три инструмента которые легко перепутать. QueryTracer не замена декоратору, декоратор не устарел, а выбор драйвера — неожиданно важное решение для observability. Какую комбинацию драйвера и обёртки выбрать — зависит от того что вы хотите видеть. В статье взгляд на комбинации драйверов и оболочек для анализа запросов в PostgreSQL. Разбираем на реальном проекте — с кодом, ошибками и выводами. Лучше один раз разобраться, чем каждый раз сомневаться в выборе.

    habr.com/ru/articles/1024854/

    #pgx #sqlx #OpenTelemetry #Prometheus #observability #трейсинг #метрики #QueryTracer #otelsql #otelpgx

  7. Модно не значит правильно — про pgx, метрики и OpenTelemetry

    Один вопрос про pgx — и три инструмента которые легко перепутать. QueryTracer не замена декоратору, декоратор не устарел, а выбор драйвера — неожиданно важное решение для observability. Какую комбинацию драйвера и обёртки выбрать — зависит от того что вы хотите видеть. В статье взгляд на комбинации драйверов и оболочек для анализа запросов в PostgreSQL. Разбираем на реальном проекте — с кодом, ошибками и выводами. Лучше один раз разобраться, чем каждый раз сомневаться в выборе.

    habr.com/ru/articles/1024854/

    #pgx #sqlx #OpenTelemetry #Prometheus #observability #трейсинг #метрики #QueryTracer #otelsql #otelpgx

  8. Модно не значит правильно — про pgx, метрики и OpenTelemetry

    Один вопрос про pgx — и три инструмента которые легко перепутать. QueryTracer не замена декоратору, декоратор не устарел, а выбор драйвера — неожиданно важное решение для observability. Какую комбинацию драйвера и обёртки выбрать — зависит от того что вы хотите видеть. В статье взгляд на комбинации драйверов и оболочек для анализа запросов в PostgreSQL. Разбираем на реальном проекте — с кодом, ошибками и выводами. Лучше один раз разобраться, чем каждый раз сомневаться в выборе.

    habr.com/ru/articles/1024854/

    #pgx #sqlx #OpenTelemetry #Prometheus #observability #трейсинг #метрики #QueryTracer #otelsql #otelpgx

  9. Модно не значит правильно — про pgx, метрики и OpenTelemetry

    Один вопрос про pgx — и три инструмента которые легко перепутать. QueryTracer не замена декоратору, декоратор не устарел, а выбор драйвера — неожиданно важное решение для observability. Какую комбинацию драйвера и обёртки выбрать — зависит от того что вы хотите видеть. В статье взгляд на комбинации драйверов и оболочек для анализа запросов в PostgreSQL. Разбираем на реальном проекте — с кодом, ошибками и выводами. Лучше один раз разобраться, чем каждый раз сомневаться в выборе.

    habr.com/ru/articles/1024854/

    #pgx #sqlx #OpenTelemetry #Prometheus #observability #трейсинг #метрики #QueryTracer #otelsql #otelpgx

  10. Wow sqlite has CTE queries!
    This improves readability a lot.

    I've used CTE queries in clickhouse before and it was a charm. Especially in combination with our nasty python f-string formatting back then.

    Sqlx does not seem to like the single row paradigm too much though.
    But for now implementing the From trait into transfer objects isn't too bad. At least the query is precise and easy to understand.

    #rust #sqlx #sqlite #cte

  11. for rust backend devs: try out clorinde (github)!

    it's a maintained fork of cornucopia, and the main premise as opposed to e.g. sqlx is that you have your queries in separate .sql files that the tool then generates bindings for!

    example: if you have this in queries/users.sql:

    --! get_followers_by_user_id
    select f.follow_state,
    f.follower_id,
    u.user_display_name
    from follower f
    left join user u on f.follower_id = u.user_id
    where f.followee_id = :id

    (the --! part is important! it sets the query name, and is also used for specifying nullable result fields/args)

    clorinde will generate a new crate in your project with a wrapper over every query that you can use e.g. like this:

    // ...
    let followers = users::get_followers_by_user_id()
    .bind(&pg_client, user_id)
    .all().await;

    for fw in follower {
    println!("{:?}", fw);
    }

    hehe i use hashtags now:
    #rust #backend #sqlx

  12. for rust backend devs: try out clorinde (github)!

    it's a maintained fork of cornucopia, and the main premise as opposed to e.g. sqlx is that you have your queries in separate .sql files that the tool then generates bindings for!

    example: if you have this in queries/users.sql:

    --! get_followers_by_user_id
    select f.follow_state,
    f.follower_id,
    u.user_display_name
    from follower f
    left join user u on f.follower_id = u.user_id
    where f.followee_id = :id

    (the --! part is important! it sets the query name, and is also used for specifying nullable result fields/args)

    clorinde will generate a new crate in your project with a wrapper over every query that you can use e.g. like this:

    // ...
    let followers = users::get_followers_by_user_id()
    .bind(&pg_client, user_id)
    .all().await;

    for fw in follower {
    println!("{:?}", fw);
    }

    hehe i use hashtags now:
    #rust #backend #sqlx

  13. for rust backend devs: try out clorinde (github)!

    it's a maintained fork of cornucopia, and the main premise as opposed to e.g. sqlx is that you have your queries in separate .sql files that the tool then generates bindings for!

    example: if you have this in queries/users.sql:

    --! get_followers_by_user_id
    select f.follow_state,
    f.follower_id,
    u.user_display_name
    from follower f
    left join user u on f.follower_id = u.user_id
    where f.followee_id = :id

    (the --! part is important! it sets the query name, and is also used for specifying nullable result fields/args)

    clorinde will generate a new crate in your project with a wrapper over every query that you can use e.g. like this:

    // ...
    let followers = users::get_followers_by_user_id()
    .bind(&pg_client, user_id)
    .all().await;

    for fw in follower {
    println!("{:?}", fw);
    }

    hehe i use hashtags now:
    #rust #backend #sqlx

  14. for rust backend devs: try out clorinde ([github](github.com/halcyonnouveau/clorinde))!

    it's a maintained fork of cornucopia, and the main premise as opposed to e.g. sqlx is that you have your queries in separate .sql files that the tool then generates bindings for!

    example: if you have this in queries/users.sql:

    --! get_followers_by_user_id
    select f.follow_state,
    f.follower_id,
    u.user_display_name
    from follower f
    left join user u on f.follower_id = u.user_id
    where f.followee_id = :id

    (the --! part is important! it sets the query name, and is also used for specifying nullable result fields/args)

    clorinde will generate a new crate in your project with a wrapper over every query that you can use e.g. like this:

    // ...
    let followers = users::get_followers_by_user_id()
    .bind(&pg_client, user_id)
    .all().await;

    for fw in follower {
    println!("{:?}", fw);
    }

    hehe i use hashtags now:
    #rust #backend #sqlx

  15. for rust backend devs: try out clorinde ([github](github.com/halcyonnouveau/clorinde))!

    it's a maintained fork of cornucopia, and the main premise as opposed to e.g. sqlx is that you have your queries in separate .sql files that the tool then generates bindings for!

    example: if you have this in queries/users.sql:

    --! get_followers_by_user_id
    select f.follow_state,
    f.follower_id,
    u.user_display_name
    from follower f
    left join user u on f.follower_id = u.user_id
    where f.followee_id = :id

    (the --! part is important! it sets the query name, and is also used for specifying nullable result fields/args)

    clorinde will generate a new crate in your project with a wrapper over every query that you can use e.g. like this:

    // ...
    let followers = users::get_followers_by_user_id()
    .bind(&pg_client, user_id)
    .all().await;

    for fw in follower {
    println!("{:?}", fw);
    }

    hehe i use hashtags now:
    #rust #backend #sqlx

  16. I built a little rust server that exposes a little website. Whenever I insert or update a task in the Postgres database, it automatically updates on the website. The whole thing is powered my pg_notify and SSE. This was very quick to build and works wonderfully!

    #postgresql #sse #sqlx

  17. I built a little rust server that exposes a little website. Whenever I insert or update a task in the Postgres database, it automatically updates on the website. The whole thing is powered my pg_notify and SSE. This was very quick to build and works wonderfully!

    #postgresql #sse #sqlx

  18. I built a little rust server that exposes a little website. Whenever I insert or update a task in the Postgres database, it automatically updates on the website. The whole thing is powered my pg_notify and SSE. This was very quick to build and works wonderfully!

    #postgresql #sse #sqlx

  19. I built a little rust server that exposes a little website. Whenever I insert or update a task in the Postgres database, it automatically updates on the website. The whole thing is powered my pg_notify and SSE. This was very quick to build and works wonderfully!

    #postgresql #sse #sqlx

  20. #SQL interfaces could use a way to conditionally enable statement rows. If one writes query by hand you enable or disable statements with just adding "--" at the beginning of the line

    SELECT * FROM example
    WHERE 1=1
    AND a = ?
    AND b = ?
    -- AND c = ?
    AND d = ?
    AND e = ?

    Similarily programming interface could have option for this, I don't see many query builders doing this ergonomically.

    In #TypeScript there is way with template literals, not with #Rust #SQLX

  21. #SQL interfaces could use a way to conditionally enable statement rows. If one writes query by hand you enable or disable statements with just adding "--" at the beginning of the line

    SELECT * FROM example
    WHERE 1=1
    AND a = ?
    AND b = ?
    -- AND c = ?
    AND d = ?
    AND e = ?

    Similarily programming interface could have option for this, I don't see many query builders doing this ergonomically.

    In #TypeScript there is way with template literals, not with #Rust #SQLX

  22. #SQL interfaces could use a way to conditionally enable statement rows. If one writes query by hand you enable or disable statements with just adding "--" at the beginning of the line

    SELECT * FROM example
    WHERE 1=1
    AND a = ?
    AND b = ?
    -- AND c = ?
    AND d = ?
    AND e = ?

    Similarily programming interface could have option for this, I don't see many query builders doing this ergonomically.

    In #TypeScript there is way with template literals, not with #Rust #SQLX

  23. #SQL interfaces could use a way to conditionally enable statement rows. If one writes query by hand you enable or disable statements with just adding "--" at the beginning of the line

    SELECT * FROM example
    WHERE 1=1
    AND a = ?
    AND b = ?
    -- AND c = ?
    AND d = ?
    AND e = ?

    Similarily programming interface could have option for this, I don't see many query builders doing this ergonomically.

    In #TypeScript there is way with template literals, not with #Rust #SQLX

  24. #SQL interfaces could use a way to conditionally enable statement rows. If one writes query by hand you enable or disable statements with just adding "--" at the beginning of the line

    SELECT * FROM example
    WHERE 1=1
    AND a = ?
    AND b = ?
    -- AND c = ?
    AND d = ?
    AND e = ?

    Similarily programming interface could have option for this, I don't see many query builders doing this ergonomically.

    In #TypeScript there is way with template literals, not with #Rust #SQLX

  25. @khleedril To certain extent you can change the backend support, and your app shall work with other database.
    #Diesel role is not to abstract what db you're using, but how you're using it, so your data is modelled in your application.

    However, saying so I observe more and more people move away from such approach in favour of more data-centric approach and prefer #sqlx in result.

  26. @khleedril To certain extent you can change the backend support, and your app shall work with other database.
    #Diesel role is not to abstract what db you're using, but how you're using it, so your data is modelled in your application.

    However, saying so I observe more and more people move away from such approach in favour of more data-centric approach and prefer #sqlx in result.

  27. @khleedril To certain extent you can change the backend support, and your app shall work with other database.
    #Diesel role is not to abstract what db you're using, but how you're using it, so your data is modelled in your application.

    However, saying so I observe more and more people move away from such approach in favour of more data-centric approach and prefer #sqlx in result.

  28. @khleedril To certain extent you can change the backend support, and your app shall work with other database.
    #Diesel role is not to abstract what db you're using, but how you're using it, so your data is modelled in your application.

    However, saying so I observe more and more people move away from such approach in favour of more data-centric approach and prefer #sqlx in result.

  29. @khleedril To certain extent you can change the backend support, and your app shall work with other database.
    #Diesel role is not to abstract what db you're using, but how you're using it, so your data is modelled in your application.

    However, saying so I observe more and more people move away from such approach in favour of more data-centric approach and prefer #sqlx in result.

  30. I've been playing with #RustLang again.
    Using #Axum #Handlebars #Htmx #Sqlx and #Sqlite
    It's a really joyful environment to work with. I'm finding it far easier than last time, a combination of much improved compiler errors, clippy guidance, #VSCode also seems to have improved understanding of the code (I'm not using #AI just Rust-Analyser and Even Better TOML
    Plus I'm building depth rather than width, fits much better for exploration and learning.
    The amount of syntax feels much reduced :-)

  31. I've been playing with #RustLang again.
    Using #Axum #Handlebars #Htmx #Sqlx and #Sqlite
    It's a really joyful environment to work with. I'm finding it far easier than last time, a combination of much improved compiler errors, clippy guidance, #VSCode also seems to have improved understanding of the code (I'm not using #AI just Rust-Analyser and Even Better TOML
    Plus I'm building depth rather than width, fits much better for exploration and learning.
    The amount of syntax feels much reduced :-)

  32. I've been playing with #RustLang again.
    Using #Axum #Handlebars #Htmx #Sqlx and #Sqlite
    It's a really joyful environment to work with. I'm finding it far easier than last time, a combination of much improved compiler errors, clippy guidance, #VSCode also seems to have improved understanding of the code (I'm not using #AI just Rust-Analyser and Even Better TOML
    Plus I'm building depth rather than width, fits much better for exploration and learning.
    The amount of syntax feels much reduced :-)

  33. I've been playing with #RustLang again.
    Using #Axum #Handlebars #Htmx #Sqlx and #Sqlite
    It's a really joyful environment to work with. I'm finding it far easier than last time, a combination of much improved compiler errors, clippy guidance, #VSCode also seems to have improved understanding of the code (I'm not using #AI just Rust-Analyser and Even Better TOML
    Plus I'm building depth rather than width, fits much better for exploration and learning.
    The amount of syntax feels much reduced :-)

  34. I've been playing with #RustLang again.
    Using #Axum #Handlebars #Htmx #Sqlx and #Sqlite
    It's a really joyful environment to work with. I'm finding it far easier than last time, a combination of much improved compiler errors, clippy guidance, #VSCode also seems to have improved understanding of the code (I'm not using #AI just Rust-Analyser and Even Better TOML
    Plus I'm building depth rather than width, fits much better for exploration and learning.
    The amount of syntax feels much reduced :-)

  35. Kalorik: Telegram-бот на Rust для анализа питания

    В данной статье мы рассмотрим архитектуру и реализацию Telegram-бота Kalorik , написанного на языке программирования Rust. Этот бот предоставляет пользователям возможность анализировать свой рацион питания, получая автоматический расчёт калорий, макроэлементов и индекса массы тела. Особенностью проекта является использование современного стека на основе tokio , sqlx , teloxide , а также продуманная архитектура с учётом масштабируемости.

    habr.com/ru/articles/910298/

    #Rust #Telegram #Боты #SQLx #PostgreSQL #AI #Машинное_обучение #OpenAI #Tokio #Асинхронное_программирование

  36. Kalorik: Telegram-бот на Rust для анализа питания

    В данной статье мы рассмотрим архитектуру и реализацию Telegram-бота Kalorik , написанного на языке программирования Rust. Этот бот предоставляет пользователям возможность анализировать свой рацион питания, получая автоматический расчёт калорий, макроэлементов и индекса массы тела. Особенностью проекта является использование современного стека на основе tokio , sqlx , teloxide , а также продуманная архитектура с учётом масштабируемости.

    habr.com/ru/articles/910298/

    #Rust #Telegram #Боты #SQLx #PostgreSQL #AI #Машинное_обучение #OpenAI #Tokio #Асинхронное_программирование

  37. Kalorik: Telegram-бот на Rust для анализа питания

    В данной статье мы рассмотрим архитектуру и реализацию Telegram-бота Kalorik , написанного на языке программирования Rust. Этот бот предоставляет пользователям возможность анализировать свой рацион питания, получая автоматический расчёт калорий, макроэлементов и индекса массы тела. Особенностью проекта является использование современного стека на основе tokio , sqlx , teloxide , а также продуманная архитектура с учётом масштабируемости.

    habr.com/ru/articles/910298/

    #Rust #Telegram #Боты #SQLx #PostgreSQL #AI #Машинное_обучение #OpenAI #Tokio #Асинхронное_программирование

  38. Kalorik: Telegram-бот на Rust для анализа питания

    В данной статье мы рассмотрим архитектуру и реализацию Telegram-бота Kalorik , написанного на языке программирования Rust. Этот бот предоставляет пользователям возможность анализировать свой рацион питания, получая автоматический расчёт калорий, макроэлементов и индекса массы тела. Особенностью проекта является использование современного стека на основе tokio , sqlx , teloxide , а также продуманная архитектура с учётом масштабируемости.

    habr.com/ru/articles/910298/

    #Rust #Telegram #Боты #SQLx #PostgreSQL #AI #Машинное_обучение #OpenAI #Tokio #Асинхронное_программирование

  39. Dear #axum + #sqlx users, has anyone managed to put a `Pool<DB>` (generic!) into your app state (`.with_state` on the router)?
    #rust

  40. Dear #axum + #sqlx users, has anyone managed to put a `Pool<DB>` (generic!) into your app state (`.with_state` on the router)?
    #rust