指南 参考 源代码
public class | 源代码

Db2QueryInterface

继承自

QueryInterface → Db2QueryInterface

Sequelize 用于与 Db2 数据库交互的接口

继承摘要

从类 QueryInterface继承
public

async addColumn(table: string, key: string, attribute: object, options: object): Promise

向表中添加新列

public

async addConstraint(tableName: string, options: object): Promise

向表中添加约束

public

async addIndex(tableName: string | object, attributes: Array, options: object, rawTablename: string): Promise

向列中添加索引

public

async bulkDelete(tableName: string, where: object, options: object, model: Model): Promise

从表中删除多条记录

public

async bulkInsert(tableName: string, records: Array, options: object, attributes: object): Promise

向表中插入多条记录

public

async bulkUpdate(tableName: string, values: object, identifier: object, options: object, attributes: object): Promise

更新表的多个记录

public

async changeColumn(tableName: string, attributeName: string, dataTypeOrOptions: object, options: object): *

更改列定义

public

async createDatabase(database: string, options: object): Promise

创建数据库

public

async createFunction(functionName: string, params: Array, returnType: string, language: string, body: string, optionsArray: Array, options: object): Promise

创建SQL函数

public

async createSchema(schema: string, options: object): Promise

创建模式

public

async createTable(tableName: string, attributes: object, options: object, model: Model): Promise

使用给定的属性集创建表

public

async describeTable(tableName: string, options: object): Promise<object>

描述表结构

public

async dropAllSchemas(options: object): Promise

删除所有模式

public

async dropAllTables(options: object): Promise

从数据库中删除所有表

public

async dropDatabase(database: string, options: object): Promise

删除数据库

public

async dropFunction(functionName: string, params: Array, options: object): Promise

删除SQL函数

public

async dropSchema(schema: string, options: object): Promise

删除模式

public

async dropTable(tableName: string, options: object): Promise

从数据库中删除表

public

async getForeignKeyReferencesForTable(tableName: string, options: object): *

获取表的外部键引用详细信息

public

async getForeignKeysForTables(tableNames: string[], options: object): Promise

返回请求表的全部外部键约束

public

将标识符列表按 "." 分割,并为每个部分添加引号

public

将标识符列表按 "." 分割,并为每个部分添加引号。

public

异步 removeColumn(tableName: 字符串, attributeName: 字符串, options: 对象): *

从表中删除一列

public

异步 removeConstraint(tableName: 字符串, constraintName: 字符串, options: 对象): *

从表中删除约束

public

异步 removeIndex(tableName: 字符串, indexNameOrAttributes: 字符串 | 字符串[], options: 对象): Promise

从表中删除已存在的索引

public

异步 renameColumn(tableName: 字符串, attrNameBefore: 字符串, attrNameAfter: 字符串, options: 对象): Promise

重命名列

public

异步 renameFunction(oldFunctionName: 字符串, params: 数组, newFunctionName: 字符串, options: 对象): Promise

重命名SQL函数

public

异步 renameTable(before: 字符串, after: 字符串, options: 对象): Promise

重命名表

public

异步 showAllSchemas(options: 对象): Promise<数组>

显示所有模式

public

异步 tableExists(tableName: TableName, options: QueryOptions): Promise<布尔值>

返回一个Promise,如果表存在于数据库中,则解析为true,否则解析为false。

public

异步 upsert(tableName: 字符串, insertValues: 对象, updateValues: 对象, where: 对象, options: 对象): Promise<布尔值, ?数字>

Upsert