queryInterface.removeConstraint() 的文档没有记录可以传递给 removeConstraint()
方法的 options
对象。事实上,没有记录可以传递给各种 queryInterface
方法的 options
对象...
options
对象是否记录在任何地方?
版本:
- Sequelize :5.21.3
- sequelize-cli:5.5.1
最佳答案
是的,该文档应该改进。这是已确认的问题 here 。如果你使用的是TypeScript,你可以在query-interface.d.ts中找到这个options
的接口(interface)。文件。
以下是"sequelize": "^5.21.3"的接口(interface)
:
/**
* Removes constraints from a table
*/
public removeConstraint(tableName: string, constraintName: string, options?: QueryInterfaceOptions): Promise<void>;
/**
* Most of the methods accept options and use only the logger property of the options. That's why the most used
* interface type for options in a method is separated here as another interface.
*/
export interface QueryInterfaceOptions extends Logging, Transactionable {}
export interface Logging {
/**
* A function that gets executed while running the query to log the sql.
*/
logging?: boolean | ((sql: string, timing?: number) => void);
/**
* Pass query execution time in milliseconds as second argument to logging function (options.logging).
*/
benchmark?: boolean;
}
export interface Transactionable {
/**
* Transaction to run query under
*/
transaction?: Transaction;
}
关于javascript - 传递给 queryInterface.removeConstraint() 的选项对象的属性是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60558485/