Permalink
Browse files

Fix postgres issue with camelCased column name during insert

  • Loading branch information...
1 parent 518de5c commit 3073283932c117bcfbb755d1164ee4f209dec740 @tone81 tone81 committed Nov 25, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/driver/pg.js
View
@@ -174,6 +174,14 @@ var PgDriver = Base.extend({
}
},
+ insert: function(tableName, columnNameArray, valueArray, callback) {
+ columnNameArray = columnNameArray.map(function(columnName) {
+ return (columnName.charAt(0) != '"') ? '"' + columnName + '"' : columnName;
+ });
+
+ return this._super(tableName, columnNameArray, valueArray, callback);
+ },
+
runSql: function() {
var callback = arguments[arguments.length - 1];

0 comments on commit 3073283

Please sign in to comment.