只读broadcasterBroadcaster used on this query runner to broadcast entity events.
只读connectionConnection used by this query runner.
Stores temporarily user data. Useful for sharing data with subscribers.
只读isIndicates if connection for this query runner is released. Once its released, query runner cannot run queries anymore.
只读isIndicates if transaction is in progress.
All synchronized tables in the database.
All synchronized views in the database.
只读managerEntity manager working only with this query runner.
Called after migrations are run.
Called before migrations are run.
Changes a column in the table.
Changes columns in the table.
Change table comment. Only supports MySQL and MariaDB
可选comment: stringRemoves all tables from the currently connected database. Be careful with using this method and avoid using it in production or migrations (because it can clear all your database).
可选database: stringFlushes all memorized sqls.
Clears all table contents. Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
Commits transaction. Error will be thrown if transaction was not started.
Creates/uses database connection from the connection pool to perform further operations. Returns obtained database connection.
Creates new check constraints.
Creates a new database.
可选ifNotExist: booleanCreates a new exclusion constraint.
Creates new exclusion constraints.
Creates a new table schema.
可选ifNotExist: booleanCreates a new unique constraint.
Creates new unique constraints.
Disables special query runner mode in which sql queries won't be executed started by calling enableSqlMemory() method.
Previously memorized sql will be flushed.
Drops columns in the table.
Drops database.
可选ifExist: booleanDrops a exclusion constraint.
Drops exclusion constraints.
Drops a foreign key.
Drops table schema. For SqlServer can accept schema path (e.g. 'dbName.schemaName') as parameter. If schema path passed, it will drop schema in specified database.
可选ifExist: boolean可选isCascade: booleanDrops an unique constraint.
Enables special query runner mode in which sql queries won't be executed, instead they will be memorized into a special variable inside query runner. You can get memorized sql using getMemorySql() method.
Executes down sql queries.
Executes up sql queries.
Loads currently using database
Loads currently using database schema
Returns all available database names including system databases.
Gets sql stored in the memory. Parameters in the sql are already replaced.
Returns replication mode (ex: master or slave).
Returns all available schema names including system schemas. If database parameter specified, returns schemas of that database. Useful for SQLServer and Postgres only.
可选database: stringChecks if a database with the given name exist.
Checks if a schema with the given name exist.
Executes a given SQL query and returns raw database results.
Executes a given SQL query and returns raw database results.
可选parameters: any[]Releases used database connection. You cannot use query runner methods after connection is released.
Renames a column.
Rollbacks transaction. Error will be thrown if transaction was not started.
Starts transaction.
可选isolationLevel: IsolationLevel
Runs queries on a single database connection.