-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
[BUG]: Time with precision in drizzle-orm/pg-core
adds double-quotes around type
#1804
Comments
Will work on this one |
@AndriiSherman Sorry about the ping, but this is currently a blocker for me. Do you have a timeline? |
I'm having the same problem with "drizzle-orm": "0.29.4", Describe the Bugimport { vector } from "pgvector/drizzle-orm";
export const table = pgTable('table_name', {
// ...
embedding: vector("embedding", { dimensions: 3 }),
// ...
}); The above table generates the following query: CREATE TABLE IF NOT EXISTS "table_name" (
"embedding" "vector(3)",
); Expected behaviorCREATE TABLE IF NOT EXISTS "table_name" (
"embedding" vector(3)
); |
I have the same problem with a CREATE TABLE IF NOT EXISTS "table_name" (
"location" "geography(Point,4326)" NOT NULL
); This will raise an SQL exception saying that the type does not exist.
My temporary solution to take advantage of migrations on this specific project was to add a script that read the SQL files generated by drizzle-kit and remove the double quotes for this specific type. {
"drizzle:mig": "drizzle-kit migrate && tsx ./remove-pgsql-quotes.ts"
} This solution solves part of the problem because I can use migrations for production deployment but I still cannot use the Openned a pull request on this #2863 |
…ive types Changed the portion of the SQL generator code that concatenates the column type to the final SQL statement, preventing the addition of double quotes. Issue drizzle-team#1804
Changed the portion of the SQL generator code that concatenates the column type to the SQL statement, preventing the addition of double quotes. Fix for drizzle-team#1804
Was fixed in |
I'm on 0.28 and I'm getting this sql statement during |
What version of
drizzle-orm
are you using?0.29.3
What version of
drizzle-kit
are you using?0.20.9
Describe the Bug
The above table generates the following query:
Expected behavior
The above table should instead generate the following query without the double quotes around the type:
Environment & setup
Client:
drizzle-orm/pg-core
Driver:
[email protected]
The text was updated successfully, but these errors were encountered: