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_driver_sqlite! compilation error without with_chrono feature #164

Closed
6xzo opened this issue Oct 15, 2021 · 2 comments
Closed

sea_query_driver_sqlite! compilation error without with_chrono feature #164

6xzo opened this issue Oct 15, 2021 · 2 comments

Comments

@6xzo
Copy link
Contributor

6xzo commented Oct 15, 2021

The sea_query_driver_sqlite! macro does not compile unless the with-chrono feature is enabled. (The other drivers are OK.)

After removing the feature and the code that depends on it from the sqlx_sqlite example:

error: examples/sqlx_sqlite/src/main.rs:7: no method named `format` found for reference `&bool` in the current scope
error: examples/sqlx_sqlite/src/main.rs:7: this error originates in a macro outside of the current crate
error: examples/sqlx_sqlite/src/main.rs:7: method not found in `&bool`
error: could not compile `sea-query-sqlx-sqlite-example`

I believe this stems from this line of code in macro bind_params_sqlx_sqlite:

                        query.bind(value.as_ref_time().map(|t| t.format("%T.f").to_string()))

Changing this line to be similar to its counterparts in the other drivers allows the code to compile, but I do not know if it actually works at runtime with sqlite. I assume there's a reason for it being different.

rustc 1.52.0 (88f19c6da 2021-05-03)
sea-query 0.17.1

@tyt2y3
Copy link
Member

tyt2y3 commented Oct 15, 2021

It is related to launchbadge/sqlx#1459
But since SQLx merged and released 0.5.9, we reverted our fixup.
0.17.2

@tyt2y3
Copy link
Member

tyt2y3 commented Oct 15, 2021

Thank you for the report. Let us know if it is still a problem.

@tyt2y3 tyt2y3 closed this as completed Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants