【发布时间】:2021-11-03 07:20:19
【问题描述】:
我已经阅读了 sequelize 文档并在 Google 上搜索了这个问题。找不到任何解释。为什么需要 BuildOptions 以及它如何影响创建的模型?
import { Sequelize, Model, DataTypes, BuildOptions } from 'sequelize';
// We need to declare an interface for our model that is basically what our class would be
interface MyModel extends Model {
readonly id: number;
}
// Need to declare the static model so `findOne` etc. use correct types.
type MyModelStatic = typeof Model & {
new (values?: object, options?: BuildOptions): MyModel;
}
【问题讨论】:
标签: typescript express sequelize.js