本文整理汇总了TypeScript中Sequelize.Sequelize.afterBulkSync方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Sequelize.afterBulkSync方法的具体用法?TypeScript Sequelize.afterBulkSync怎么用?TypeScript Sequelize.afterBulkSync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sequelize.Sequelize
的用法示例。
在下文中一共展示了Sequelize.afterBulkSync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Sequelize
import { QueryTypes, Sequelize, SyncOptions } from 'sequelize';
import { User } from 'models/User';
export const sequelize = new Sequelize('uri');
sequelize.afterBulkSync((options: SyncOptions) => {
console.log('synced');
});
sequelize
.query('SELECT * FROM `test`', {
type: QueryTypes.SELECT,
})
.then(rows => {
rows.forEach(row => {
console.log(row);
});
});
sequelize
.query('INSERT into test set test=1', {
type: QueryTypes.INSERT,
})
.then(([aiId, affected]) => {
console.log(aiId, affected);
});
sequelize.transaction<void>(async transaction => {
const rows = await sequelize
.query('SELECT * FROM `user`', {
retry: {