-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Support partial index #405
Conversation
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.
@kyoto7250 thank you! LGTM!
/// assert_eq!( | ||
/// index.to_string(PostgresQueryBuilder), | ||
/// r#"CREATE INDEX "idx-glyph-aspect" ON "glyph" ("aspect" (64) ASC) WHERE "glyph"."aspect" IN ($1, $2)"# | ||
/// ); | ||
/// assert_eq!( | ||
/// index.to_string(SqliteQueryBuilder), | ||
/// r#"CREATE INDEX "idx-glyph-aspect" ON "glyph" ("aspect" ASC) WHERE "glyph"."aspect" IN (?, ?)"# | ||
/// ); |
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.
Hey @kyoto7250, thanks again for contributing!!
For index statement, it doesn't support value binding. So, instead of writing a placeholder to the SQL - ?
for MySQL and $N
for PostgreSQL. It should just write the value in string. This QueryBuilder::value_to_string
would come in handy.
/// assert_eq!( | |
/// index.to_string(PostgresQueryBuilder), | |
/// r#"CREATE INDEX "idx-glyph-aspect" ON "glyph" ("aspect" (64) ASC) WHERE "glyph"."aspect" IN ($1, $2)"# | |
/// ); | |
/// assert_eq!( | |
/// index.to_string(SqliteQueryBuilder), | |
/// r#"CREATE INDEX "idx-glyph-aspect" ON "glyph" ("aspect" ASC) WHERE "glyph"."aspect" IN (?, ?)"# | |
/// ); | |
/// assert_eq!( | |
/// index.to_string(PostgresQueryBuilder), | |
/// r#"CREATE INDEX "idx-glyph-aspect" ON "glyph" ("aspect" (64) ASC) WHERE "glyph"."aspect" IN (3, 4)"# | |
/// ); | |
/// assert_eq!( | |
/// index.to_string(SqliteQueryBuilder), | |
/// r#"CREATE INDEX "idx-glyph-aspect" ON "glyph" ("aspect" ASC) WHERE "glyph"."aspect" IN (3, 4)"# | |
/// ); |
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.
Hey @kyoto7250, got any updates on this? :)
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.
@kyoto7250 hello! Any updates?)
@kyoto7250 please, resolve conflict) |
Hello. I missed that this PR exists, so I have not responded to @billy1624 's comment . If you are not in a hurry, could you please wait a little longer? If you are in a hurry, you can close this PR and create another one. |
@kyoto7250 take you time! |
I couldn't fix the conflicts cleanly, so I created #478. This PR is old and I will close it. |
PR Info
close #396
We supports partial index by this PR.
Adds