0
我對這個庫(knex)頗爲陌生,並且遇到了一個問題,我一直無法在interwebs上找到解決方案。插入顯示所有空值
這裏是我的Knex連接:
Knex({client: 'pg', connection: config.DB, searchPath:'syp,public', debug: true})
這裏是我的插入:
Knex('users')
.returning('id')
.insert(data)
.then(function(user) {
console.log(user);
}, function(err) {
console.log(err)
});
這是我data
從上述查詢:
{
"first_name": "Kenneth",
"last_name": "Stowell",
"email": "[email protected]" }
產生的錯誤是:
code:"42703"
file:"parse_target.c"
length:119
line:"943"
name:"error"
position:"230"
routine:"checkInsertTargets"
severity:"ERROR"
這將使意義,因爲調試器顯示出下面的SQL:
sql:"insert into "users" ("first_name", "last_name", "email") values (?, ?, ?) returning "id""
我希望我只是做一個新手的錯誤,但我不能爲我的生命找出原因。它似乎正在使綁定正確,但從未應用它們。
任何幫助表示讚賞!