Fields coming back as snake case from DB
I've been following the tanstackdb-electric-starter pretty heavily for my project and just noticed a weird issue.
When my electric collection retrieves fields, it retrieves them snake cased (
I am following the same convention as the starter project, using drizzle and zod schema for my collection's schemas. It's not like a huge deal, but type-safety is gone now
hello_world
)I am following the same convention as the starter project, using drizzle and zod schema for my collection's schemas. It's not like a huge deal, but type-safety is gone now
GitHub
electric/examples/tanstack-db-web-starter at main · electric-sql/e...
Real-time sync for Postgres. Contribute to electric-sql/electric development by creating an account on GitHub.

2 Replies
conscious-sapphire•2w ago
electric is just returning whatevers in your db
you can have your types generated w/ snake_case (that's how the starter works)
or you can have camelCase types & transform all the data (like drizzle would internally for queries)
I just use snake_case 🤷
foreign-sapphireOP•2w ago
That’s what I thought!
How do you set this up? The starter has a snake case parameter in the db connection but I don’t see anything else making the types be generated as snake case
oh wait nvm, you just have the fields as snake case... ill adjust