import { type QueryRunner } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/query-runner/QueryRunner.ts";
Runs queries on a single database connection.
Properties
Indicates if connection for this query runner is released. Once its released, query runner cannot run queries anymore.
Methods
Creates/uses database connection from the connection pool to perform further operations. Returns obtained database connection.
Releases used database connection. You cannot use query runner methods after connection is released.
Removes 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).
Commits transaction. Error will be thrown if transaction was not started.
Ends transaction. Error will be thrown if transaction was not started.
Executes a given SQL query and returns raw database results.
Returns raw data stream.
Returns all available schema names including system schemas. If database parameter specified, returns schemas of that database. Useful for SQLServer and Postgres only.
Loads a table by a given name from the database.
Loads all tables from the database and returns them.
todo: make tablePaths optional
Checks if a column exist in the table.
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.
Creates a new table.
Drops a table.
Renames a column.
Changes a column in the table.
Changes columns in the table.
Drops a column in the table.
Drops columns in the table.
Creates a new primary key.
Updates composite primary keys.
Creates a new unique constraint.
Creates new unique constraints.
Drops an unique constraint.
Drops unique constraints.
Creates a new check constraint.
Creates new check constraints.
Drops a check constraint.
Drops check constraints.
Creates a new exclusion constraint.
Creates new exclusion constraints.
Drops a exclusion constraint.
Drops exclusion constraints.
Creates a new foreign key.
Creates new foreign keys.
Drops a foreign key.
Drops foreign keys.
Clears all table contents. Note: this operation uses SQL's TRUNCATE query which cannot be reverted in transactions.
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.
Disables special query runner mode in which sql queries won't be executed started by calling enableSqlMemory() method.
Previously memorized sql will be flushed.
Gets sql stored in the memory. Parameters in the sql are already replaced.