本文整理汇总了TypeScript中Sequelize.Sequelize.getQueryInterface方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Sequelize.getQueryInterface方法的具体用法?TypeScript Sequelize.getQueryInterface怎么用?TypeScript Sequelize.getQueryInterface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sequelize.Sequelize
的用法示例。
在下文中一共展示了Sequelize.getQueryInterface方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: handleDelete
public handleDelete(deleteOp: DBRemoveOp<any>) {
return this.sequelize.getQueryInterface().QueryGenerator.deleteQuery(
deleteOp.model.getTableName(),
deleteOp.options.where,
{ ...deleteOp.options, limit: null },
deleteOp.model
);
}
示例2: handleInsert
public handleInsert(insertOp: DBCreateOp<any>) {
return this.sequelize.getQueryInterface().QueryGenerator.insertQuery(
insertOp.model.getTableName(),
insertOp.values,
insertOp.model.rawAttributes,
{}
);
}
示例3: handleUpdate
public handleUpdate(updateOp: DBUpdateOp<any>) {
return this.sequelize.getQueryInterface().QueryGenerator.updateQuery(
updateOp.model.getTableName(),
updateOp.values,
updateOp.options.where,
updateOp.options
);
}
示例4: handleUpsert
public handleUpsert(upsertOp: DBUpsertOp<any>) {
return this.sequelize.getQueryInterface().QueryGenerator.upsertQuery(
upsertOp.model.getTableName(),
upsertOp.values,
upsertOp.values,
{ [Op.or]: [{ [upsertOp.model.primaryKeyAttribute]: upsertOp.values[upsertOp.model.primaryKeyAttribute] }] },
upsertOp.model,
{ raw: true }
// upsertOp.options.wh
);
}