Open nrdobie opened 3 months ago
I'm also experiencing this issue e.g the generated SQL looks like:
`CREATE TABLE IF NOT EXISTS "my_table" (
"areas" "geometry(Polygon,4326)"
)
with geometry in quotations
I am also having this issue. We are having to manually remove the quotes which is a pain. I would offer a patch to the tool however the drizzle-kit source does not seem to be generally available? 😅
It looks like drizzle-kit 0.22 has added "geometry("
to the list of pgNativeTypes
string prefixes.
This doesn't let you use "geometry" on its own as a type, but maybe there's a way to work around that on the sql side?
~Seems like maybe postgis lets you say geometry()
?~
oops nvm:
psql:/home/runner/work/drizzle-postgis/drizzle-postgis/src/test/schema-snapshot.sql:18: ERROR: syntax error at or near ")"
LINE 3: "geometry" geometry(),
Looks like geometry(Geometry) might work though. Passes my tests anyway.
The drizzle-kit update doesn't support box2d/box3d columns in case anyone is using that.
FWIW I've been trying to get this stuff working over at https://github.com/Schmavery/drizzle-postgis in case that helps anyone.
When attempting to use the PostgreSQL PostGIS
geometry
data type,drizzle-kit
will currently quote it and break the ability to use DB push.This is the custom type I am trying to use:
This is the generated SQL:
The issue comes specifically from this line in the Drizzle Kit code:
Either extend
isPgNativeType
to include geometry as a native type or add support for using thesql
orsql.raw
as part of thedataType
return.This would make using drizzle with geospatial data usable.