javascript - 传递给 queryInterface.removeConstraint() 的选项对象的属性是什么?

标签 javascript node.js sequelize.js

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/

相关文章:

javascript - forEach循环中的异步函数与js

node.js - 在nodejs中使用socket.io进行ping测试时出现巨大延迟

mysql - 在 Sequelize 中使用 MySQL FIELD 函数

javascript - NPM 实时服务器不会加载我的项目网站

javascript - 为多个按钮添加事件监听器

javascript - 上传文件而不提交的脚本

node.js - 如何从nodejs请求捕获像MaxListenersExceededWarning这样的错误?

node.js - 谷歌分析步骤从 API 获取每页的浏览量

mysql - 在一对多关联的 CREATE 期间出现 Sequelize 错误 "Unknown column in ' 字段列表'"

sequelize.js - Sequelize 将 UTC 时间转换为错误的本地区域