Wrong docs on casing

The docs chat bot suggests this but that seems wrong
const db = drizzle(client, { casing: 'snake_case' })
const db = drizzle(client, { casing: 'snake_case' })
Where can I specify the rule for the column aliases? Right now it's a lot of noise responseId: bigint('response_id')
13 Replies
Mozzy
Mozzy3mo ago
That seems right to me, but you also might want to add that to the Drizzle config file
tcurdt
tcurdtOP3mo ago
TS says it does not belong there.
Mozzy
Mozzy3mo ago
Which Drizzle versions are you on? I believe it was added in yesterday's releases
tcurdt
tcurdtOP3mo ago
"drizzle-orm": "0.33.0", "drizzle-kit": "0.24.2", Well, that would explain that 🙂
Mozzy
Mozzy3mo ago
Yup, updating both should fix it
tcurdt
tcurdtOP3mo ago
I need to add it in both places?
Mozzy
Mozzy3mo ago
I think so You'll need it in the config for the drizzle-kit commands
tcurdt
tcurdtOP3mo ago
but for the config file I've only found "preserve" and "camelCase" would that need to be "preserve" then? I don't quite understand the duality of it yet.
Mozzy
Mozzy3mo ago
I have this when using postgres
No description
tcurdt
tcurdtOP3mo ago
adding it in both places then 🤷‍♂️ thanks for the help!
Mozzy
Mozzy3mo ago
Just tried without adding it in drizzle(). It breaks the ORM part
Andrii Sherman
Andrii Sherman3mo ago
you should have it in both places if you want to use casing in both orm part and drizzle generate/push parts
Mozzy
Mozzy3mo ago
:CatThumbsUp:
Want results from more Discord servers?
Add your server