📜  迁移文件中的 knex.raw - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:53.333000             🧑  作者: Mango

代码示例1
knex('users')
  .select(knex.raw('count(*) as user_count, status'))
  .where(knex.raw(1))
  .orWhere(knex.raw('status <> ?', [1]))
  .groupBy('status')Outputs:select count(*) as user_count, status from `users` where 1 or status <> 1 group by `status`