Create query inserts quotes for customType with push

Hey people. So i am using PostGIS as my database, and i created a custom type for the geogrraphy point
export const geoPoint = customType<{ data: never }>({
dataType() {
return "geography(Point, 4326)";
},
toDriver(value: Point) {
return sql`ST_MakePoint(${value.latitude}, ${value.longitude})`;
},
});
export const geoPoint = customType<{ data: never }>({
dataType() {
return "geography(Point, 4326)";
},
toDriver(value: Point) {
return sql`ST_MakePoint(${value.latitude}, ${value.longitude})`;
},
});
The issue lies when i use drizzle-kit push, it makes a create query that puts the type inside quotations marks (which breaks the db query) How do i make it so that it creates the DB creation query correctly ?
...
"coords" "geography(Point, 4326)" NOT NULL,
...
...
"coords" "geography(Point, 4326)" NOT NULL,
...
error: type "geography(Point, 4326)" does not exist
error: type "geography(Point, 4326)" does not exist
1 Reply
Aaroned
Aaroned9mo ago
GitHub
[BUG]: 'type "geography(Point)" does not exist' when using push:pg ...
What version of drizzle-orm are you using? 0.28.6 What version of drizzle-kit are you using? 0.19.13 Describe the Bug drizzle-kit push:pg does not complete when using a custom type and trying to pu...
Want results from more Discord servers?
Add your server