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

using COALESCE when making an index, escapes the comma in the function #3350

Closed
bondehagen opened this issue Jun 12, 2024 · 3 comments · May be fixed by #3962
Closed

using COALESCE when making an index, escapes the comma in the function #3350

bondehagen opened this issue Jun 12, 2024 · 3 comments · May be fixed by #3962
Labels
bug Something isn't working db/sqlite drizzle/kit priority Will be worked on next

Comments

@bondehagen
Copy link

bondehagen commented Jun 12, 2024

This is what I expect to get:

CREATE UNIQUE INDEX `IndexName` ON `Table` (`foo`, COALESCE (`bar`, ''));

This is my schema definition:

uniqueIndex("IndexName").on(table.foo, sql`COALESCE(${table.bar}, '')`)

COALESCE gets wrong escaping:

CREATE UNIQUE INDEX `IndexName` ON `Table` (`foo`,`COALESCE("bar"`,` '')`);

This is for the sqlite dialect with:
drizzle-orm: 0.31.2
drizzle-kit: 0.22.6

@anasouardini
Copy link

This still open?

@L-Mario564 L-Mario564 transferred this issue from drizzle-team/drizzle-kit-mirror Nov 1, 2024
@L-Mario564 L-Mario564 added bug Something isn't working drizzle/kit db/sqlite priority Will be worked on next labels Nov 1, 2024
@AndriiSherman
Copy link
Member

should not be an issue on latest(0.30.0+), if it's still an issue - please reopen

@bondehagen
Copy link
Author

@AndriiSherman, @anasouardini This is not fixed. Tested with [email protected] and [email protected], please repoen again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working db/sqlite drizzle/kit priority Will be worked on next
Projects
None yet
4 participants