async-sqlx-session's People
Forkers
bbigras caelunshun erzauge isgasho martin-kolarik gallaghercommajack cyrusalbright kiwiyou torsteingrindvik 66oj66 eklipse2k8 charlesvdv evertedsphere dcchut arqu mtorromeo avtrujilloasync-sqlx-session's Issues
Sqlx macros fails on build, every time
Repro steps:
cargo new bad-sqlx-sessions
cd bad-sqlx-sessions
cargo add async-sqlx-session -F pg
cargo run
It will fail to build. Error text below because it is so long, but the punchline is the version of sqlx-macros used in this project is broken from the start, as discussed here: launchbadge/sqlx#2418 .
The "fix" from a consumer perspective is easy, just cargo add sqlx
and then I get the updated sqlx macros and everything works -- and I expect most people using this package will want sqlx as well. But this package is still technically broken in its current state. I would think the fix is simply to update https://github.com/jbr/async-sqlx-session/blob/main/Cargo.toml -- but the version of sqlx in that is 0.6.2 whereas the errors for sqlx-macros are coming from 0.5.13 . Perhaps those versions are not kept in sync, but if they are, maybe the problem is coming from somewhere else.
Errors building:
...
Compiling async-session v3.0.0
Compiling sqlx-macros v0.5.13
error[E0432]: unresolved import `syn::spanned`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/attributes.rs:4:10
|
4 | use syn::spanned::Spanned;
| ^^^^^^^ could not find `spanned` in `syn`
error[E0432]: unresolved import `syn::DeriveInput`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/attributes.rs:6:22
|
6 | use syn::{Attribute, DeriveInput, Field, Lit, Meta, MetaNameValue, NestedMeta, Variant};
| ^^^^^^^^^^^ no `DeriveInput` in the root
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:64
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^^^^
= note: the item is gated behind the `derive` feature
error[E0432]: unresolved imports `syn::parse_quote`, `syn::Data`, `syn::DataEnum`, `syn::DataStruct`, `syn::DeriveInput`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:11:5
|
11 | parse_quote, Arm, Data, DataEnum, DataStruct, DeriveInput, Field, Fields, FieldsNamed,
| ^^^^^^^^^^^ ^^^^ ^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ no `DeriveInput` in the root
| | | | |
| | | | no `DataStruct` in the root
| | | no `DataEnum` in the root
| | no `Data` in the root
| no `parse_quote` in the root
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:443:9
|
443 | pub mod parse_quote;
| ^^^^^^^^^^^
= note: the item is gated behind the `parsing` feature
= help: consider importing this variant instead:
serde_json::error::Category::Data
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:25
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:31
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:41
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:64
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^^^^
= note: the item is gated behind the `derive` feature
help: a similar name exists in the module
|
11 | parse_quote, Arm, data, DataEnum, DataStruct, DeriveInput, Field, Fields, FieldsNamed,
| ~~~~
help: a similar name exists in the module
|
11 | parse_quote, Arm, Data, DataEnum, PatStruct, DeriveInput, Field, Fields, FieldsNamed,
| ~~~~~~~~~
error[E0432]: unresolved imports `syn::parse_quote`, `syn::Data`, `syn::DataEnum`, `syn::DataStruct`, `syn::DeriveInput`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/encode.rs:11:5
|
11 | parse_quote, Data, DataEnum, DataStruct, DeriveInput, Expr, Field, Fields, FieldsNamed,
| ^^^^^^^^^^^ ^^^^ ^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ no `DeriveInput` in the root
| | | | |
| | | | no `DataStruct` in the root
| | | no `DataEnum` in the root
| | no `Data` in the root
| no `parse_quote` in the root
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:443:9
|
443 | pub mod parse_quote;
| ^^^^^^^^^^^
= note: the item is gated behind the `parsing` feature
= help: consider importing this variant instead:
serde_json::error::Category::Data
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:25
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:31
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:41
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:64
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^^^^
= note: the item is gated behind the `derive` feature
help: a similar name exists in the module
|
11 | parse_quote, data, DataEnum, DataStruct, DeriveInput, Expr, Field, Fields, FieldsNamed,
| ~~~~
help: a similar name exists in the module
|
11 | parse_quote, Data, DataEnum, PatStruct, DeriveInput, Expr, Field, Fields, FieldsNamed,
| ~~~~~~~~~
error[E0432]: unresolved imports `syn::parse_quote`, `syn::Data`, `syn::DataStruct`, `syn::DeriveInput`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:4:5
|
4 | parse_quote, punctuated::Punctuated, token::Comma, Data, DataStruct, DeriveInput, Field,
| ^^^^^^^^^^^ ^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ no `DeriveInput` in the root
| | | |
| | | no `DataStruct` in the root
| no `parse_quote` in the root no `Data` in the root
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:443:9
|
443 | pub mod parse_quote;
| ^^^^^^^^^^^
= note: the item is gated behind the `parsing` feature
= help: consider importing this variant instead:
serde_json::error::Category::Data
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:25
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:41
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:64
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^^^^
= note: the item is gated behind the `derive` feature
help: a similar name exists in the module
|
4 | parse_quote, punctuated::Punctuated, token::Comma, data, DataStruct, DeriveInput, Field,
| ~~~~
help: a similar name exists in the module
|
4 | parse_quote, punctuated::Punctuated, token::Comma, Data, PatStruct, DeriveInput, Field,
| ~~~~~~~~~
error[E0432]: unresolved imports `syn::parse_quote`, `syn::Data`, `syn::DataEnum`, `syn::DataStruct`, `syn::DeriveInput`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/type.rs:10:5
|
10 | parse_quote, Data, DataEnum, DataStruct, DeriveInput, Field, Fields, FieldsNamed,
| ^^^^^^^^^^^ ^^^^ ^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ no `DeriveInput` in the root
| | | | |
| | | | no `DataStruct` in the root
| | | no `DataEnum` in the root
| | no `Data` in the root
| no `parse_quote` in the root
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:443:9
|
443 | pub mod parse_quote;
| ^^^^^^^^^^^
= note: the item is gated behind the `parsing` feature
= help: consider importing this variant instead:
serde_json::error::Category::Data
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:25
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:31
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:41
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^^^
= note: the item is gated behind the `derive` feature
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:64
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^^^^
= note: the item is gated behind the `derive` feature
help: a similar name exists in the module
|
10 | parse_quote, data, DataEnum, DataStruct, DeriveInput, Field, Fields, FieldsNamed,
| ~~~~
help: a similar name exists in the module
|
10 | parse_quote, Data, DataEnum, PatStruct, DeriveInput, Field, Fields, FieldsNamed,
| ~~~~~~~~~
error[E0432]: unresolved import `syn::DeriveInput`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/mod.rs:16:5
|
16 | use syn::DeriveInput;
| ^^^^^^^^^^^^^^^^ no `DeriveInput` in the root
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:392:64
|
392 | pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
| ^^^^^^^^^^^
= note: the item is gated behind the `derive` feature
error[E0432]: unresolved import `syn::spanned`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/query/args.rs:7:10
|
7 | use syn::spanned::Spanned;
| ^^^^^^^ could not find `spanned` in `syn`
error[E0432]: unresolved import `syn::parse`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/query/input.rs:4:10
|
4 | use syn::parse::{Parse, ParseStream};
| ^^^^^ could not find `parse` in `syn`
error[E0432]: unresolved import `syn::parse`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/query/output.rs:12:10
|
12 | use syn::parse::{Parse, ParseStream};
| ^^^^^ could not find `parse` in `syn`
error[E0433]: failed to resolve: could not find `parse_macro_input` in `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/lib.rs:29:22
|
29 | let input = syn::parse_macro_input!(input as query::QueryMacroInput);
| ^^^^^^^^^^^^^^^^^ could not find `parse_macro_input` in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:452:9
|
452 | pub mod parse_macro_input;
| ^^^^^^^^^^^^^^^^^
error[E0433]: failed to resolve: could not find `parse_macro_input` in `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/lib.rs:46:22
|
46 | let input = syn::parse_macro_input!(tokenstream as syn::DeriveInput);
| ^^^^^^^^^^^^^^^^^ could not find `parse_macro_input` in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:452:9
|
452 | pub mod parse_macro_input;
| ^^^^^^^^^^^^^^^^^
error[E0433]: failed to resolve: could not find `parse_macro_input` in `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/lib.rs:55:22
|
55 | let input = syn::parse_macro_input!(tokenstream as syn::DeriveInput);
| ^^^^^^^^^^^^^^^^^ could not find `parse_macro_input` in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:452:9
|
452 | pub mod parse_macro_input;
| ^^^^^^^^^^^^^^^^^
error[E0433]: failed to resolve: could not find `parse_macro_input` in `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/lib.rs:64:22
|
64 | let input = syn::parse_macro_input!(tokenstream as syn::DeriveInput);
| ^^^^^^^^^^^^^^^^^ could not find `parse_macro_input` in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:452:9
|
452 | pub mod parse_macro_input;
| ^^^^^^^^^^^^^^^^^
error[E0433]: failed to resolve: could not find `parse_macro_input` in `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/lib.rs:73:22
|
73 | let input = syn::parse_macro_input!(input as syn::DeriveInput);
| ^^^^^^^^^^^^^^^^^ could not find `parse_macro_input` in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:452:9
|
452 | pub mod parse_macro_input;
| ^^^^^^^^^^^^^^^^^
error[E0433]: failed to resolve: could not find `parse_macro_input` in `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/lib.rs:86:22
|
86 | let input = syn::parse_macro_input!(input as LitStr);
| ^^^^^^^^^^^^^^^^^ could not find `parse_macro_input` in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:452:9
|
452 | pub mod parse_macro_input;
| ^^^^^^^^^^^^^^^^^
error[E0433]: failed to resolve: could not find `parse_macro_input` in `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/lib.rs:103:22
|
103 | let input = syn::parse_macro_input!(input as syn::ItemFn);
| ^^^^^^^^^^^^^^^^^ could not find `parse_macro_input` in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:452:9
|
452 | pub mod parse_macro_input;
| ^^^^^^^^^^^^^^^^^
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:67:20
|
67 | .insert(0, parse_quote!(DB: ::sqlx::Database));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:68:31
|
68 | generics.params.insert(0, parse_quote!('r));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:72:15
|
72 | .push(parse_quote!(#ty: ::sqlx::decode::Decode<'r, DB>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:155:13
|
155 | parse_quote!(#rename => ::std::result::Result::Ok(#ident :: #id),)
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:159:13
|
159 | parse_quote!(#name => ::std::result::Result::Ok(#ident :: #id),)
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:162:13
|
162 | parse_quote!(#name => ::std::result::Result::Ok(#ident :: #id),)
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:274:35
|
274 | generics.params.insert(0, parse_quote!('r));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:281:29
|
281 | predicates.push(parse_quote!(#ty: ::sqlx::decode::Decode<'r, ::sqlx::Postgres>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:282:29
|
282 | predicates.push(parse_quote!(#ty: ::sqlx::types::Type<::sqlx::Postgres>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:291:13
|
291 | parse_quote!(
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/encode.rs:73:20
|
73 | .insert(0, parse_quote!(DB: ::sqlx::Database));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/encode.rs:77:15
|
77 | .push(parse_quote!(#ty: ::sqlx::encode::Encode<#lifetime, DB>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/encode.rs:221:23
|
221 | .push(parse_quote!(#ty: for<'q> ::sqlx::encode::Encode<'q, ::sqlx::Postgres>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/encode.rs:222:29
|
222 | predicates.push(parse_quote!(#ty: ::sqlx::types::Type<::sqlx::Postgres>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/encode.rs:230:13
|
230 | parse_quote!(
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/encode.rs:239:13
|
239 | parse_quote!(
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:56:31
|
56 | generics.params.insert(0, parse_quote!(R: ::sqlx::Row));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:59:35
|
59 | generics.params.insert(0, parse_quote!(#lifetime));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:64:21
|
64 | predicates.push(parse_quote!(&#lifetime ::std::primitive::str: ::sqlx::ColumnIndex<R>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:69:25
|
69 | predicates.push(parse_quote!(#ty: ::sqlx::decode::Decode<#lifetime, R::Database>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:70:25
|
70 | predicates.push(parse_quote!(#ty: ::sqlx::types::Type<R::Database>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:93:17
|
93 | parse_quote!(let #id: #ty = row.try_get(#id_s).or_else(|e| match e {
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:101:18
|
101 | Some(parse_quote!(
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:140:31
|
140 | generics.params.insert(0, parse_quote!(R: ::sqlx::Row));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:143:35
|
143 | generics.params.insert(0, parse_quote!(#lifetime));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:148:21
|
148 | predicates.push(parse_quote!(
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:155:25
|
155 | predicates.push(parse_quote!(#ty: ::sqlx::decode::Decode<#lifetime, R::Database>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/row.rs:156:25
|
156 | predicates.push(parse_quote!(#ty: ::sqlx::types::Type<R::Database>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/type.rs:65:24
|
65 | .insert(0, parse_quote!(DB: ::sqlx::Database));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/type.rs:69:19
|
69 | .push(parse_quote!(#ty: ::sqlx::Type<DB>));
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the macro `parse_quote`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/derives/decode.rs:108:13
|
108 | parse_quote! {
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error[E0425]: cannot find function `parse_str` in crate `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/database/mod.rs:18:14
|
18 | syn::parse_str(Self::DATABASE_PATH).unwrap()
| ^^^^^^^^^ not found in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:917:8
|
917 | pub fn parse_str<T: parse::Parse>(s: &str) -> Result<T> {
| ^^^^^^^^^
= note: the item is gated behind the `parsing` feature
error[E0425]: cannot find function `parse_str` in crate `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/database/mod.rs:22:14
|
22 | syn::parse_str(Self::ROW_PATH).unwrap()
| ^^^^^^^^^ not found in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:917:8
|
917 | pub fn parse_str<T: parse::Parse>(s: &str) -> Result<T> {
| ^^^^^^^^^
= note: the item is gated behind the `parsing` feature
error[E0425]: cannot find function `parse_str` in crate `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/query/output.rs:270:22
|
270 | syn::parse_str(remainder)?
| ^^^^^^^^^ not found in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:917:8
|
917 | pub fn parse_str<T: parse::Parse>(s: &str) -> Result<T> {
| ^^^^^^^^^
= note: the item is gated behind the `parsing` feature
error[E0425]: cannot find function `parse_str` in crate `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/query/output.rs:325:33
|
325 | if let Ok(ident) = syn::parse_str(&ident) {
| ^^^^^^^^^ not found in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:917:8
|
917 | pub fn parse_str<T: parse::Parse>(s: &str) -> Result<T> {
| ^^^^^^^^^
= note: the item is gated behind the `parsing` feature
error[E0425]: cannot find function `parse_str` in crate `syn`
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-macros-0.5.13/src/query/mod.rs:318:46
|
318 | let record_name: Type = syn::parse_str("Record").unwrap();
| ^^^^^^^^^ not found in `syn`
|
note: found an item that was configured out
--> /home/chris/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:917:8
|
917 | pub fn parse_str<T: parse::Parse>(s: &str) -> Result<T> {
| ^^^^^^^^^
= note: the item is gated behind the `parsing` feature
Some errors have detailed explanations: E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0425`.
error: could not compile `sqlx-macros` (lib) due to 53 previous errors
Option to rename session table
It would be nice to be able to config the name of session table.
https://github.com/jbr/async-sqlx-session/blob/main/src/pg.rs#L52
Publish new version to crates.io
I see that sqlx was updated here 3f2e1cf
Would you be able to publish a new version to crates.io with this upgrade please?
PgPool
I am having a weird error.
mismatched types [E0308] expected `sqlx_core::postgres::PgPool`, found `Pool<Postgres>
For this
let session_store = PostgresSessionStore::from_client(pool.clone());
Where pool: PgPool
I wonder if it is because I am using tokio
while this one only support async-std
?
https://github.com/jbr/async-sqlx-session/blob/main/Cargo.toml#L17-L27
Disable logging?
How can I disable logging when I use it with tide
? Currently it displays every query in my terminal as sqlx::query SOME_QUERY
.
cannot differientate between sqlx::postgres::PgPool and sqlx_core::postgres::PgPool in from_client
The issue im having is that I am trying to pass in a Pool object to the PostgresSessionStore::from_client(pool) and it gives me an issue of mismatched types Pool and Pool I am using the latest version of all, slqx = 0.7.1 and async-sqlx-session = 0.4.0 if you have any fixes let me know
TIMESTAMP WITH ZONE
Very minor thing but I wonder why we would want to store TIMESTAMP WITH ZONE, it is probably better not to store ZONE and the code is using Utc::now
anyway.
https://github.com/jbr/async-sqlx-session/blob/main/src/pg.rs#L157
Persisting PostgresSessionStore between server restarts
Hi, I have an Axum server and was using MemoryStore
. I just swapped that for PostgresSessionStore
. I can see that between browser page reloads that my session is persisting but when I quit my server and restart it then reload the browser again, it seems the session is lost. I can see the async_sessions
table in my db has been created.
Here is how I'm configuring it,
// session cookie ------ start
let store = PostgresSessionStore::new(&db_url)
.await
.map_err(|e| {
eprintln!("Database error: {:?}", e);
RestAPIError::InternalServerError
})
.unwrap();
store.migrate().await.unwrap();
store.spawn_cleanup_task(Duration::from_secs(60 * 60));
// I couldn't see how three lines from the async-sqlx-sesssion example were needed with Axum.
// let mut session = Session::new();
// let cookie_value = store.store_session(session).await.unwrap().unwrap();
// let session = store.load_session(cookie_value).await.unwrap();
let secret = random::<[u8; 128]>();
let session_layer = SessionLayer::new(store, &secret)
.with_secure(true)
.with_same_site_policy(SameSite::Strict);
// session cookie ------ end
...
let routes_all = Router::new()
...
.layer(session_layer)
.layer(Extension(app_state))
.fallback_service(routes_static());
In my login route I just update the session like this:
async fn api_login(
mut session: WritableSession,
Extension(app_state): Extension<Arc<AppState>>,
payload: Json<LoginRequestPostPayload>,
) -> RestAPIResult<Json<StandardSuccessResponseData>> {
...
session
.insert("token", payload.token.to_string())
.map_err(|_| RestAPIError::UpdateSessionFail)?;
Ok(Json(StandardSuccessResponseData::new()))
}
Would you please help me identify the gap?
Crate depends on async_std for seemingly no reason
Trying to integrate this crate into a project using Warp which is built on Tokio, so I'm using the sqlx crate with the runtime-tokio-native-tls
option, but in this crate, the first line of the features in the Cargo.toml file is default = ["native-tls"]
which leads to further down the features list native-tls = ["sqlx/runtime-async-std-native-tls"]
, so it's using a conflicting sqlx runtime.
It looks like recent efforts were made on this crate to move away from a dependency on async-std, so I would appreciate if this could be fixed. To keep current projects working, it should be possible to keep the existing defaults and have a feature to enable using the Tokio runtime.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.