Giter Club home page Giter Club logo

async-sqlx-session's People

Contributors

caelunshun avatar dependabot-preview[bot] avatar dependabot[bot] avatar gallaghercommajack avatar jbr avatar martin-kolarik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

async-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

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.

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.