Ask HN: Db column naming: snake_case vs. CamelCase, what's the best convention?
2•jerawaj740•4mo ago
Comments
leakycap•4mo ago
snake_case because if your column ends up in a Postgres/MySQL environment your CamelCase will be become camelcase
And reading those becomes nightmares
If you are just working in Javascript/Node.js, CamelCase is the preferred option.
catlover76•4mo ago
It's camelCase, not CamelCase
I believe this is PascalCase
tuatoru•4mo ago
SHOUTY_CASE
ompogUe•4mo ago
Snowflake forces this, so you would also never get CamelCase w/o always quoting the column name in your queries.
ompogUe•4mo ago
Depending upon how you organize the words within them (*_id, *_name, *_percent), snake case allows you to parse the column names dynamically for things like santization and formatting.
leakycap•4mo ago
And reading those becomes nightmares
If you are just working in Javascript/Node.js, CamelCase is the preferred option.