I am following Airbnb's style guide for my eslint, which throws an error when I try to create database fields with snake case names. I was told that snake case is the standard for database naming convention. Should I disable eslint on all database lines?
Asked
Active
Viewed 357 times
1 Answers
0
Well, this just depends on your preferences.
But if you are using Postgres using came case could cause some issues. Postgres requires this names to be escaped with "
so field name would be "myField"
instead my_field
if you have to write queries by hands.
This could cause some annoyance if you are executing SQL from code, not by ORM's query generator.
So basically: you could use any naming convention in DB. But using mixed case would cause some pain in PG if you have to write SQL queries.
P.S. You could tune linter for particular file/class. And you could configure ORM to auto-generate snake_case from camelCase fields.

Bogdan Mart
- 460
- 8
- 19