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
I'm adopting sea-query in a tokio-postgres project, but I hit some trouble where the sea_query_postgres::PostgresBinder trait has no effect, and so it's difficult to convert bind values to the types needed to pass to postgres.
Steps to Reproduce
Clone sea-query repo and cd examples/postgres/
Run the following two commands to switch the sea-query dependencies to the latest releases (with the features used by the example): cargo add [email protected] -F with-uuid,with-chrono,with-json,with-time,postgres-array,with-rust_decimal cargo add [email protected] -F with-uuid,with-chrono,with-json,with-time,postgres-array,with-rust_decimal
Run cargo build
Expected Behavior
The example compiles cleanly.
Actual Behavior
λ cargo build
Compiling sea-query-postgres-example v0.1.0 ([…]/sea-query/examples/postgres)
error[E0599]: no method named `build_postgres` found for mutable reference `&mut sea_query::InsertStatement` in the current scope
--> src/main.rs:118:10
|
88 | let (sql, values) = Query::insert()
| _________________________-
89 | | .into_table(Document::Table)
90 | | .columns([
91 | | Document::Uuid,
... |
117 | | ])
118 | | .build_postgres(PostgresQueryBuilder);
| | -^^^^^^^^^^^^^^ method not found in `&mut InsertStatement`
| |_________|
|
error[E0599]: no method named `build_postgres` found for mutable reference `&mut sea_query::SelectStatement` in the current scope
--> src/main.rs:138:10
|
125 | let (sql, values) = Query::select()
| _________________________-
126 | | .columns([
127 | | Document::Id,
128 | | Document::Uuid,
... |
137 | | .limit(1)
138 | | .build_postgres(PostgresQueryBuilder);
| | -^^^^^^^^^^^^^^ method not found in `&mut SelectStatement`
| |_________|
|
warning: unused import: `sea_query_postgres::PostgresBinder`
--> src/main.rs:6:5
|
6 | use sea_query_postgres::PostgresBinder;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
For more information about this error, try `rustc --explain E0599`.
warning: `sea-query-postgres-example` (bin "sea-query-postgres-example") generated 1 warning
error: could not compile `sea-query-postgres-example` (bin "sea-query-postgres-example") due to 2 previous errors; 1 warning emitted
λ cargo tree | g sea-
sea-query-postgres-example v0.1.0 ([…]/sea-query/examples/postgres)
├── sea-query v0.30.0
│ ├── sea-query-derive v0.4.0 (proc-macro)
├── sea-query-postgres v0.3.0
│ └── sea-query v0.29.1
λ rustc --version
rustc 1.70.0 (90c541806 2023-05-31)
λ uname -a
Linux […] 5.4.0-144-generic #161-Ubuntu SMP Fri Feb 3 14:49:04 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Additional Information
Downgrading the example to sea-query 0.29.1 via cargo add [email protected] -F with-uuid,with-chrono,with-json,with-time,postgres-array,with-rust_decimal appears to fix the problem, presumably because now the two sea-query versions (the one used by example and the one used by sea-query-postgres) are consistent.
Also, this probably goes without saying, but the example also compiles cleanly when using the git master versions. I reckon the fix here is to ship a sea-query-postgres 0.3.1 that bumps its sea-query dependency to 0.30.0?
The text was updated successfully, but these errors were encountered:
sartak
changed the title
Postgres example no longer compiles with released versions
Postgres support for bind params broken
Aug 20, 2023
sartak
changed the title
Postgres support for bind params broken
sea-query-postgres support for bind params compile error
Aug 20, 2023
sea-query-postgres 0.3 is meant to be paired with sea-query 0.29
Due to a dependency upgrade sea-query 0.30 would require a new version (0.4) for sea-query-postgres.
But 0.30 and 0.29 is otherwise identical.
I might make a new release this week.
Description
I'm adopting sea-query in a tokio-postgres project, but I hit some trouble where the
sea_query_postgres::PostgresBinder
trait has no effect, and so it's difficult to convert bind values to the types needed to pass to postgres.Steps to Reproduce
cd examples/postgres/
cargo add [email protected] -F with-uuid,with-chrono,with-json,with-time,postgres-array,with-rust_decimal
cargo add [email protected] -F with-uuid,with-chrono,with-json,with-time,postgres-array,with-rust_decimal
cargo build
Expected Behavior
The example compiles cleanly.
Actual Behavior
Reproduces How Often
Happens every time as of a784868
Versions
Additional Information
Downgrading the example to sea-query 0.29.1 via
cargo add [email protected] -F with-uuid,with-chrono,with-json,with-time,postgres-array,with-rust_decimal
appears to fix the problem, presumably because now the two sea-query versions (the one used by example and the one used by sea-query-postgres) are consistent.Also, this probably goes without saying, but the example also compiles cleanly when using the git master versions. I reckon the fix here is to ship a sea-query-postgres 0.3.1 that bumps its sea-query dependency to 0.30.0?
The text was updated successfully, but these errors were encountered: