My Frontend is consuming data from both my NodeJs backend and Supabase, how to manage snake case of postgres in this typescript
Using both camel cases and snake case is making my codebase messier
Arsh Goyal is seeking advice on managing the use of snake_case from PostgreSQL in a NodeJs TypeScript application. The challenge is maintaining consistency between camelCase and snake_case, which is causing codebase complexity. Gobishankar Rathinam suggests converting snake_case to camelCase at the database boundary to streamline the codebase.
I would keep snake_case at the database boundary because it matches PostgreSQL and the generated Supabase types. Then convert the result to camelCase once in a mapper before passing it into the rest of the application. That keeps the conversion in one place instead of mixing both naming styles throughout the codebase.