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
Mozzy2mo ago
That seems right to me, but you also might want to add that to the Drizzle config file
tcurdt
tcurdtOP2mo ago
TS says it does not belong there.
Mozzy
Mozzy2mo ago
Which Drizzle versions are you on? I believe it was added in yesterday's releases
tcurdt
tcurdtOP2mo ago
"drizzle-orm": "0.33.0", "drizzle-kit": "0.24.2", Well, that would explain that 🙂
Mozzy
Mozzy2mo ago
Yup, updating both should fix it
tcurdt
tcurdtOP2mo ago
I need to add it in both places?
Mozzy
Mozzy2mo ago
I think so You'll need it in the config for the drizzle-kit commands
tcurdt
tcurdtOP2mo 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
Mozzy2mo ago
I have this when using postgres
No description
tcurdt
tcurdtOP2mo ago
adding it in both places then 🤷‍♂️ thanks for the help!
Mozzy
Mozzy2mo ago
Just tried without adding it in drizzle(). It breaks the ORM part
Andrii Sherman
Andrii Sherman2mo ago
you should have it in both places if you want to use casing in both orm part and drizzle generate/push parts
Mozzy
Mozzy2mo ago
:CatThumbsUp:
Want results from more Discord servers?
Add your server