【发布时间】:2021-11-11 15:38:42
【问题描述】:
我是 knex 的新手。我在迁移时遇到了困难。插入数据似乎工作得很好。但是,当我尝试在迁移中查询数据时,出现意外错误。
这个查询:
await knex.select().from('account_types').where({ key: t.key }).first()
产生这个错误:
error: select (select *) from "public"."account_types" where "key" = $1 limit $2 - SELECT * with no tables specified is not valid
显然生成的查询是无效的,但我不知道为什么它会随机插入“select *”
【问题讨论】:
标签: knex.js