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

Support partial index #405

Closed
wants to merge 1 commit into from
Closed

Support partial index #405

wants to merge 1 commit into from

Conversation

kyoto7250
Copy link
Contributor

PR Info

close #396
We supports partial index by this PR.

Adds

  • support partial index.

Copy link
Member

@ikrivosheev ikrivosheev left a 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!

@kyoto7250 kyoto7250 marked this pull request as ready for review August 7, 2022 23:20
Comment on lines +137 to +144
/// 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 (?, ?)"#
/// );
Copy link
Member

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.

Suggested change
/// 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)"#
/// );

Copy link
Member

@billy1624 billy1624 Aug 29, 2022

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? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kyoto7250 hello! Any updates?)

@ikrivosheev ikrivosheev self-requested a review August 19, 2022 09:21
@ikrivosheev
Copy link
Member

@kyoto7250 please, resolve conflict)

@kyoto7250
Copy link
Contributor Author

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.

@ikrivosheev
Copy link
Member

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!

@kyoto7250 kyoto7250 mentioned this pull request Oct 16, 2022
3 tasks
@kyoto7250
Copy link
Contributor Author

I couldn't fix the conflicts cleanly, so I created #478.

This PR is old and I will close it.

@kyoto7250 kyoto7250 closed this Oct 16, 2022
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.

Support for partial index
3 participants