Runs queries on a single SQL Server database connection.
Broadcaster used on this query runner to broadcast entity events.
Connection used by this query runner.
Stores temporarily user data. Useful for sharing data with subscribers.
Real database connection from a connection pool used to perform queries.
Database driver used by connection.
Indicates if connection for this query runner is released. Once its released, query runner cannot run queries anymore.
Indicates if transaction is in progress.
All synchronized tables in the database.
Entity manager working only with current query runner.
Mode in which query runner executes. Used for replication. If replication is not setup its value is ignored.
Last executed query in a transaction. This is needed because in transaction mode mssql cannot execute parallel queries, that's why we store last executed query promise to wait it when we execute next query.
Sql-s stored if "sql in memory" mode is enabled.
Indicates if special query runner mode in which sql queries won't be executed is enabled.
Concat database name and schema name to the foreign key name. Needs because FK name is relevant to the schema and database.
Changes a column in the table.
Removes all tables from the currently connected database.
Flushes 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.
Converts string literal of isolation level to enum. The underlying mssql driver requires an enum for the isolation level.
Creates a new database.
Creates a new primary key.
Builds create primary key sql.
Creates table schema. If database name also specified (e.g. 'dbName.schemaName') schema will be created in specified database.
Creates a new table.
Builds and returns SQL for create table.
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 a primary key.
Builds drop primary key sql.
Drops table schema. If database name also specified (e.g. 'dbName.schemaName') schema will be dropped in specified database.
Drops the table.
Builds drop table sql.
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.
Escapes given table name.
Executes down sql queries.
Executes up sql queries.
Executes sql used special for schema build.
Gets table from previously loaded tables, otherwise loads it from database.
Return current database.
Return current schema.
Returns all available database names including system databases.
Gets sql stored in the memory. Parameters in the sql are already replaced.
Returns all available schema names including system schemas. If database parameter specified, returns schemas of that database.
Loads given table's data from the database.
Loads all tables (with given names) from the database.
Checks if column exist in the table.
Checks if database with the given name exist.
Checks if schema with the given name exist.
Checks if table with the given name exist in the database.
Checks if at least one of column properties was changed. Does not checks column type, length and autoincrement, because these properties changes separately.
Loads all tables (with given names) from the database and creates a Table from them.
Converts MssqlParameter into real mssql parameter type.
Executes a given SQL query.
Releases used database connection. You cannot use query runner methods once its released.
Removes parenthesis around default value. Sql server returns default value with parenthesis around, e.g. ('My text') - for string ((1)) - for number (newsequentialId()) - for function
Renames a table.
Rollbacks transaction. Error will be thrown if transaction was not started.
Returns raw data stream.
Generated using TypeDoc