paint-brush
“camelCase” < = > “snake_case” conversion with PostgreSQL and Knex.jsby@tarkus
10,490 reads
10,490 reads

“camelCase” < = > “snake_case” conversion with PostgreSQL and Knex.js

by Konstantin Tarkus2mMay 21st, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

If you’re building a <a href="https://github.com/kriasoft/nodejs-api-starter" target="_blank">GraphQL data API</a>, most likely you want to use <strong>lowerCamelCase </strong>names for all the fields in your GraphQL schema as recommended by the <a href="http://facebook.github.io/graphql/" target="_blank">GraphQL specification</a>. But, it’s likely that your database is using a different convention. For example, in case with PostgreSQL, the practical naming convention to use is <strong>snake_case</strong> (feel free to ask why in the comments bellow). Let’s see a couple of solutions to this problem.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - “camelCase” < = > “snake_case” conversion with PostgreSQL and Knex.js
Konstantin Tarkus HackerNoon profile picture
Konstantin Tarkus

Konstantin Tarkus

@tarkus

L O A D I N G
. . . comments & more!

About Author

Konstantin Tarkus HackerNoon profile picture
Konstantin Tarkus@tarkus

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite