Conversation
ikrivosheev
left a comment
There was a problem hiding this comment.
@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.
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)"# | |
| /// ); |
|
@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