eXecuteye
eXecuteye
DTDrizzle Team
Created by eXecuteye on 7/29/2024 in #help
allow passing undefined to limit
The 0.32.1 release (https://github.com/drizzle-team/drizzle-orm/releases/tag/0.32.1) added support for limit 0 in all dialects... However, in some cases i used "0" as a fallback for "do not apply limit" (as if limit was undefined, which is not allowed currently) Pointed out as workaround in this issue: https://github.com/drizzle-team/drizzle-orm/issues/728#issuecomment-1581806431 Is there some other way to define the .limit(limitNum) where limit is only applied if limit is defined? Can we allow undefined to be passed to limit() to not apply it?
1 replies
DTDrizzle Team
Created by eXecuteye on 6/20/2024 in #help
drizzle postgis geometry always geometry(point)
Hello, i am currently testing out the basic postGis support and it would be nice if i can get it working as desired... Basically i want point/pointZ and linestring/linestringZ... The 0.31.0 release added geometry from the PostgreSQL PostGIS extension, however, as indicated it currently only supports type: "point". But the release also states, that we can specify any other string to use some other type...
type

The current release has a predefined type: point, which is the geometry(Point) type in the PostgreSQL PostGIS extension. You can specify any string there if you want to use some other type
type

The current release has a predefined type: point, which is the geometry(Point) type in the PostgreSQL PostGIS extension. You can specify any string there if you want to use some other type
i was wondering what steps are necessary to get eg: linestring to work? point: geometry("point", { type: "point" }), or point: geometry("point", { type: "pointZ" }),results in:
CREATE TABLE "test" (
"point" geometry(point)
)
CREATE TABLE "test" (
"point" geometry(point)
)
on drizzle-kit generate with linestring i tried: linestring: geometry("linestring", { type: "linestring" }) or linestring: geometry("linestring", { type: "linestringZ" }) resulting in:
CREATE TABLE "test" (
"linestring" geometry(point)
)
CREATE TABLE "test" (
"linestring" geometry(point)
)
on drizzle-kit generate the only way to get around this issue that i am currently aware is just manually swap out the geometry(point) with geometry(linestring) in the generated sql and then migrate...
3 replies
DTDrizzle Team
Created by eXecuteye on 6/17/2024 in #help
drizzle-kit generate not working with unhelpful error message
Ian into an issue with generate yesterday and can't really make sense of the error...

drizzle-kit: v0.22.7
drizzle-orm: v0.31.2

Reading config file '..../api/db/drizzle.config.ts'
....

....
rJ3fWPYaXdHqpHH2HP3X+c6ES9Jc8V/JjCws6mMBf99wfnyvluee3led/gulufeBH4sV58xilr/zSMhhf6M70BXIhd/YtcmI9vt1r7/8BPnl3FAA=) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
^

SyntaxError: Invalid or unexpected token
at internalCompileFunction (node:internal/vm:77:18)
at wrapSafe (node:internal/modules/cjs/loader:1288:20)
at Module._compile (node:internal/modules/cjs/loader:1340:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at newLoader (..../node_modules/drizzle-kit/bin.cjs:17468:13)
at Object.newLoader (..../node_modules/drizzle-kit/bin.cjs:17468:13)
at extensions..js (..../node_modules/drizzle-kit/bin.cjs:19996:28)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)

drizzle-kit: v0.22.7
drizzle-orm: v0.31.2

Reading config file '..../api/db/drizzle.config.ts'
....

....
rJ3fWPYaXdHqpHH2HP3X+c6ES9Jc8V/JjCws6mMBf99wfnyvluee3led/gulufeBH4sV58xilr/zSMhhf6M70BXIhd/YtcmI9vt1r7/8BPnl3FAA=) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
^

SyntaxError: Invalid or unexpected token
at internalCompileFunction (node:internal/vm:77:18)
at wrapSafe (node:internal/modules/cjs/loader:1288:20)
at Module._compile (node:internal/modules/cjs/loader:1340:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at newLoader (..../node_modules/drizzle-kit/bin.cjs:17468:13)
at Object.newLoader (..../node_modules/drizzle-kit/bin.cjs:17468:13)
at extensions..js (..../node_modules/drizzle-kit/bin.cjs:19996:28)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
Downgrading drizzle-orm or drizzle-kit version does not change anything (min version tried: orm: 32.0 and kit:22.0 -> (did not go lower because since v32 the new drizzle kit version was required and a drizzle-kit up was done and the config changes were applied, etc...)) I dont know if any change in my schemas causes this issue but the schemas seem correct to me... Because i don't know what causes this looking at the error message i have a hard time debugging this... Did you run into the same issue or was yours of different nature?
2 replies