【发布时间】:2017-11-08 03:46:38
【问题描述】:
console.log(columnsets.activites.forInsert)
给我
ColumnSet {
table: "accounting"."activities"
columns: [
Column {
name: "note"
}
Column {
name: "title"
}
Column {
name: "context_id"
prop: "contextId"
}
Column {
name: "created_timestamp"
prop: "createdTimestamp"
}
Column {
name: "created_by_id"
prop: "createdById"
}
Column {
name: "object_id"
prop: "objectId"
cnd: true
}
]
}
pgp.helpers.insert({ contextId: user.objectId, createdById: user.objectId, createdTimestamp: now, note: null, objectId: uuid.v4(), title: MESSAGE_SUCCESS_USER_AUTHENTICATE }, columnSets.activities.forInsert)
我可以发誓它直到最近才为我工作。我不确定发生了什么变化。我设置了表名但为什么抱怨Error: Table name is unknown.
【问题讨论】:
-
如果你的
columnSets.activities.forInsert不是带有指定表的ColumnSet对象,它只会这样抱怨。很可能是undefined或其他东西;) -
@vitaly-t i 控制台将其记录下来,如图所示:S
-
这样就不会抱怨了,肯定是有什么问题。我建议调试以查看缺少的内容;)
-
@vitaly-t 会调查一下。它以前有效,我没有改变任何东西
-
这是很多开发人员使用的
ColumnSet类型的最基本功能。它不仅会自行停止工作,还必须有其他事情发生,某些事情未包含在您展示的代码中。唯一有意义的是,如果columnSets.activities.forInsert不包含您在将其传递到方法helpers.insert时的想法。
标签: javascript pg-promise