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

Did you find this page helpful?