Ask HN: Db column naming: snake_case vs. CamelCase, what's the best convention?

2 points by jerawaj740 ↗ HN

4 comments

[ 2.1 ms ] story [ 18.1 ms ] thread
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.

It's camelCase, not CamelCase

I believe this is PascalCase

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.