ガイド リファレンス ソース
public class | source

MySQLQueryInterface

拡張

QueryInterface → MySQLQueryInterface

SequelizeがMySQL/MariaDBデータベースと通信するために使用するインターフェース

メソッドの概要

公開メソッド
public

async removeColumn(tableName: *, columnName: *, options: *): *

外部キー制約がある場合に、既存のテーブルから列をクリーンに削除できないMySQLの欠点を修正するラッパー。

public

async removeConstraint(tableName: *, constraintName: *, options: *): *

public

async upsert(tableName: *, insertValues: *, updateValues: *, where: *, options: *): *

継承された概要

クラス 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

quoteIdentifier(identifier: string, force: boolean): string

識別子のリストを"."で分割し、各部分を引用符で囲みます

public

quoteIdentifiers(identifiers: string): string

識別子のリストを"."で分割し、各部分を引用符で囲みます。

public

async removeColumn(tableName: string, attributeName: string, options: object): *

テーブルからカラムを削除します

public

async removeConstraint(tableName: string, constraintName: string, options: object): *

テーブルから制約を削除します

public

async removeIndex(tableName: string, indexNameOrAttributes: string | string[], options: object): Promise

テーブルから既存のインデックスを削除します。

public

async renameColumn(tableName: string, attrNameBefore: string, attrNameAfter: string, options: object): Promise

カラムの名前を変更します。

public

async renameFunction(oldFunctionName: string, params: Array, newFunctionName: string, options: object): Promise

SQL関数の名前を変更します。

public

async renameTable(before: string, after: string, options: object): Promise

テーブルの名前を変更します。

public

async showAllSchemas(options: object): Promise<Array>

すべてのスキーマを表示します。

public

async tableExists(tableName: TableName, options: QueryOptions): Promise<boolean>

テーブルがデータベースに存在する場合は true、それ以外の場合は false に解決される Promise を返します。

public

async upsert(tableName: string, insertValues: object, updateValues: object, where: object, options: object): Promise<boolean, ?number>

Upsert(存在すれば更新、なければ挿入)を行います。

公開メソッド

public async removeColumn(tableName: *, columnName: *, options: *): * source

外部キー制約がある場合に、既存のテーブルから列をクリーンに削除できないMySQLの欠点を修正するラッパー。

オーバーライド

QueryInterface#removeColumn

パラメータ

名前属性説明
tableName *
columnName *
options *

戻り値

*

public async removeConstraint(tableName: *, constraintName: *, options: *): * source

テーブルから制約を削除します

オーバーライド

QueryInterface#removeConstraint

パラメータ

名前属性説明
tableName *
constraintName *
options *

戻り値

*

public async upsert(tableName: *, insertValues: *, updateValues: *, where: *, options: *): * source

Upsert(存在すれば更新、なければ挿入)を行います。

オーバーライド

QueryInterface#upsert

パラメータ

名前属性説明
tableName *
insertValues *
updateValues *
where *
options *

戻り値

*