pg-camelcase
About
Changes the fieldnames of a query result from snake_case_nameing to camelCaseNaming. The module exposes two functions:
#inject(pg)
: changes the internals of pg to change the result as desribed. Also, it returns a function which can be called to revert this change#camelCase(str)
: returns the stringstr
converted to camel case
Example:
var pg = ;var pgCamelCase = ;var revertCamelCase = ; pg; ; // deactivate/revert the camel casing pg;
Tests
If you run npm test
and
- the environment variable
TEST_PG_CONNECTION
is set pg
orpg.js
is installed
tests a running against an real server and the real result is checked. This should be the default for the tests on travis.