Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sea-query-binder] enable SQLx features if and only if SQLx optional dependency is enabled #517

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

billy1624
Copy link
Member

PR Info

Bug Fixes

  • This allows user to have a SeaORM entity crate without enabling any db driver
The error without `sqlx?/xxx`
➜ cargo b
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
   Compiling sea-query-binder v0.2.1
error[E0004]: non-exhaustive patterns: `sea_query::Value::Json(_)`, `sea_query::Value::ChronoDate(_)`, `sea_query::Value::ChronoTime(_)` and 10 more not covered
   --> /Users/billy/.cargo/registry/src/github.com-1ecc6299db9ec823/sea-query-binder-0.2.1/src/sqlx_mysql.rs:9:19
    |
9   |             match arg {
    |                   ^^^ patterns `sea_query::Value::Json(_)`, `sea_query::Value::ChronoDate(_)`, `sea_query::Value::ChronoTime(_)` and 10 more not covered
    |
note: `sea_query::Value` defined here
   --> /Users/billy/.cargo/registry/src/github.com-1ecc6299db9ec823/sea-query-0.27.1/src/value.rs:121:1
    |
121 | pub enum Value {
    | ^^^^^^^^^^^^^^
    = note: the matched value is of type `sea_query::Value`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
    |
51  ~                 }
52  +                 _ => todo!()
    |

error[E0004]: non-exhaustive patterns: `sea_query::Value::Json(_)`, `sea_query::Value::ChronoDate(_)`, `sea_query::Value::ChronoTime(_)` and 10 more not covered
   --> /Users/billy/.cargo/registry/src/github.com-1ecc6299db9ec823/sea-query-binder-0.2.1/src/sqlx_postgres.rs:25:19
    |
25  |             match arg {
    |                   ^^^ patterns `sea_query::Value::Json(_)`, `sea_query::Value::ChronoDate(_)`, `sea_query::Value::ChronoTime(_)` and 10 more not covered
    |
note: `sea_query::Value` defined here
   --> /Users/billy/.cargo/registry/src/github.com-1ecc6299db9ec823/sea-query-0.27.1/src/value.rs:121:1
    |
121 | pub enum Value {
    | ^^^^^^^^^^^^^^
    = note: the matched value is of type `sea_query::Value`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
    |
67  ~                 }
68  +                 _ => todo!()
    |

error[E0004]: non-exhaustive patterns: `sea_query::Value::Json(_)`, `sea_query::Value::ChronoDate(_)`, `sea_query::Value::ChronoTime(_)` and 10 more not covered
   --> /Users/billy/.cargo/registry/src/github.com-1ecc6299db9ec823/sea-query-binder-0.2.1/src/sqlx_sqlite.rs:9:19
    |
9   |             match arg {
    |                   ^^^ patterns `sea_query::Value::Json(_)`, `sea_query::Value::ChronoDate(_)`, `sea_query::Value::ChronoTime(_)` and 10 more not covered
    |
note: `sea_query::Value` defined here
   --> /Users/billy/.cargo/registry/src/github.com-1ecc6299db9ec823/sea-query-0.27.1/src/value.rs:121:1
    |
121 | pub enum Value {
    | ^^^^^^^^^^^^^^
    = note: the matched value is of type `sea_query::Value`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
    |
51  ~                 }
52  +                 _ => todo!()
    |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `sea-query-binder` due to 3 previous errors

@billy1624 billy1624 self-assigned this Nov 10, 2022
@billy1624 billy1624 marked this pull request as ready for review November 10, 2022 04:16
@ikrivosheev ikrivosheev merged commit d63de2c into master Nov 10, 2022
@ikrivosheev ikrivosheev deleted the binder-sqlx-features-opt branch November 10, 2022 08:04
@tyt2y3
Copy link
Member

tyt2y3 commented Nov 11, 2022

Good stuff

@billy1624
Copy link
Member Author

Should this be backport to 0.27.x?

Then, we can release this, SeaQL/sea-orm#1213, in sea-orm 0.10.x

@tyt2y3
Copy link
Member

tyt2y3 commented Nov 11, 2022

Yes, sounds doable

@tyt2y3
Copy link
Member

tyt2y3 commented Nov 11, 2022

This can just be a minor bump to sea-query-binder, and no new version is needed on sea-query

@billy1624
Copy link
Member Author

Okay, then I will wait on the release of SeaQuery before jumping back into SeaQL/sea-orm#1213.

@billy1624 billy1624 mentioned this pull request Nov 11, 2022
1 task
@tyt2y3
Copy link
Member

tyt2y3 commented Nov 11, 2022

https://crates.io/crates/sea-query-binder/versions I released

tyt2y3 pushed a commit that referenced this pull request Nov 11, 2022
[sea-query-binder] enable SQLx features if and only if SQLx optional dependency is enabled
@ikrivosheev
Copy link
Member

@tyt2y3, thank you!

@billy1624
Copy link
Member Author

That was fast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants