-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Query to check for index existence #115
Conversation
src/mysql/probe.rs
Outdated
{ | ||
Query::select() | ||
.expr_as(Expr::cust("COUNT(*) > 0"), Alias::new("has_index")) | ||
.from((Alias::new("information_schema"), Alias::new("statistics"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g.
use InformationSchema as Schema;
.from((Schema::Schema, Schema::Statistics))
sea-schema/src/mysql/query/schema.rs
Line 16 in 93f5321
pub enum InformationSchema { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution.
I think the original probe.rs really had set a bad example.
Can you reuse the existing enums where possible, instead of using Alias::new
?
Yeah can do. What else needs to be replaced? And should I change the existing code as well? |
I have refactored the existing code already ) |
@tyt2y3 This is ready to be reviewed. |
Tested by running: # sea-orm-migration/Cargo.toml
[patch.crates-io]
sea-schema = { path = "../../sea-schema" } DATABASE_URL='sqlite::memory:' cargo test --manifest-path sea-orm-migration/Cargo.toml --test '*' --features sqlx-sqlite,runtime-async-std-rustls
DATABASE_URL='postgres://postgres:password@ipaddress:8000' cargo test --manifest-path sea-orm-migration/Cargo.toml --test '*' --features sqlx-postgres,runtime-async-std-rustls
DATABASE_URL='mysql://mysql:password@ipaddress:8000' cargo test --manifest-path sea-orm-migration/Cargo.toml --test '*' --features sqlx-mysql,runtime-async-std-rustls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
@tyt2y3 When will this be released? Since SeaQL/sea-orm#1828 depends on this. |
I will probably make a minor release this week. Meanwhile you can override the dependency to using git, pointing to this repo. |
Would you mind if we wait for the release to include the |
No I think it would be better if it was separate. @tyt2y3 |
🎉 Released In 0.14.1 🎉Thank you everyone for the contribution! |
This will allow me to implement the required methods for SeaQL/sea-orm#1827.