You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i am new to rust, i am using SQLX to manage my database connection, but i want to use tokio-postgres and map the row result with the types from SQLX its that posible?, thanks.
The text was updated successfully, but these errors were encountered:
The question doesn't really make sense because SQLx and tokio-postgres are competing solutions. What do you need that tokio-postgres does but SQLx doesn't?
You can execute plain query strings (including multiple statements separated by semicolons) by importing the Executor trait and then calling the relevant methods directly on a connection:
use sqlx::Executor;letmut conn:PgConnection = ...;conn.execute("insert into foo(...) ...; update foo set bar = true where id > 1").await?;// same as `sqlx::query(...).fetch(&mut conn)`letmut results = conn.fetch("select id, bar from foo");
The downside here is that you cannot use bind parameters with these queries.
Postgres COPY support is being discussed in #36 and I have a branch that mostly just needs to be rebased and tested.
Hi, i am new to rust, i am using SQLX to manage my database connection, but i want to use
tokio-postgres
and map the row result with the types from SQLX its that posible?, thanks.The text was updated successfully, but these errors were encountered: