-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
Postgres only has lowercase column names unless you put everything in quotes. node-postgres returns an array of objects. These objects will therefore all have lowercase property names despite the convention in javascript for camelcase.
Mapping the returned array to a new array is a waste of resources. I think it would be a good idea to have a configuration option for the driver so that you can input a map, such as:
{ 'userid': 'userId', 'refreshtoken': 'refreshToken' }
Which would then be used in result.js to make a new fields array:
var field = this.fields[i].name
to allow the returned objects to respect the naming convention of the programming language instead of the database and prevent bugs.
charmander, sehrope and vitaly-t