jsonb field definition.

What's the right way to define a jsonb field? I have a type type MetaData = {keywords?: string[];} and a field meta: jsonb<MetaData>("meta"), but I'm getting the typescript warnings Type 'PgJsonbBuilderInitial<MetaData>' is not assignable to type 'AnyPgColumnBuilder'.ts(2322) on the lhs and Type 'MetaData' does not satisfy the constraint 'string'.ts(2344) on the rhs. Thanks in advance.
B
bloberenober406d ago
Check the jsonb examples in the docs
J
Julio2049406d ago
Thanks for the response. @bloberenober Do you have a pointer to the docs that you think would be helpful? I looked in the md files in the repo and see some examples such as jsonb: jsonb<string[]>('jsonb') but no clear discussion (that I can understand) on what to do or what could be causing the does not satisfy the constraint error that I get.
B
bloberenober406d ago
It's an outdated version - could you share where did you find this example? Here's an example with the correct syntax - https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/pg-core/README.md#column-types
J
Julio2049406d ago
Ok. Thanks. The syntax must have changed without my noticing it. I appreciate it.
B
bloberenober406d ago
Could you share where did you find the example with the old syntax?
J
Julio2049406d ago
I had it working with the old syntax before the latest update so I must have originally found it in drizzle-orm-pg 0.15.1
B
bloberenober406d ago
I see - it's a rather old version
Want results from more Discord servers?
Add your server
More Posts
"Extend" tables by other tablesHey all, first of all great work with drizzle. Haven't had the time to play around with it so far. Bmaximum call stack exceededWeird bug where whenever I add a `where` `eq` clause getting maximum call stack exceededDrizzle recommended way to migrate resetApologies if this is a stupid question, I just recently migrated out of prisma and into drizzle. Onecompound uniqueIndexIn Prisma, I have in my schema definition the following declaration that requires userId and timestaplanetscale: how to index col using drizzle?Hi, seems most of the samples are pg. I'm using planetscale, and no having any luck figuring out how[Bug?] Drizzle generates a broken query when passing an explicit value for a column as `undefined`I've translated most of my logic from Prisma usage -> Drizzle. Noticed an issue where when explicitlHelp improving my queryIf feel like this is far from how what it actually should look like in drizzle could I get some poinLeft join with JSONI'm using PlanetScale (MySQL) and have 2 tables: orders and products. Every order contains basic infDrizzle-kit throws module not found error for internal files imported through absolute pathI've attached the error log and how the error was fixed.drizzle bug won't let me update mysql tablewrote a bug ticket on github describing the bug but just wanted to post here as well for visibility Generated Collate valueNot sure if this is relevant but I'm translating a Prisma schema into drizzle. Every Prisma table haCan I know when I can use Mysql proxy driver?Hi, I’m Daun and I’m a huge fan of drizzle. i’m really grateful that drizzle is open source and haveMocking databaseI want to mock the PostgreSQL database and access it with Drizzle ORM. I tried to write a TypeScriptWhat does MySQL bigint config mode do?In a mysql schema, when creating a bigint, it wants a config object with a `mode` key where mode couMySQL unique constraintIn the drizzle schema, is there a way to label a column with unique constraint in mysql? I'm only seError querying planetscale dbTrying to get setup with drizzle and running into this error. There's not much info here so I'm not db push connection errorgetting the following error on my first db push attempt ``` Ignoring invalid configuration option paSelect existsHi there, I was wondering if there is currently a good way of performing a ‘select exists’, to chec