Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseQueryRunner

Hierarchy

Index

Properties

broadcaster

broadcaster: Broadcaster

Broadcaster used on this query runner to broadcast entity events.

connection

connection: Connection

Connection used by this query runner.

data

data: object

Stores temporarily user data. Useful for sharing data with subscribers.

Type declaration

Protected databaseConnection

databaseConnection: any

Real database connection from a connection pool used to perform queries.

isReleased

isReleased: boolean = false

Indicates if connection for this query runner is released. Once its released, query runner cannot run queries anymore.

isTransactionActive

isTransactionActive: boolean = false

Indicates if transaction is in progress.

loadedTables

loadedTables: Table[] = []

All synchronized tables in the database.

loadedViews

loadedViews: View[] = []

All synchronized views in the database.

manager

manager: EntityManager

Entity manager working only with current query runner.

Protected mode

mode: "master" | "slave"

Mode in which query runner executes. Used for replication. If replication is not setup its value is ignored.

Protected sqlInMemory

sqlInMemory: SqlInMemory = new SqlInMemory()

Sql-s stored if "sql in memory" mode is enabled.

Protected sqlMemoryMode

sqlMemoryMode: boolean = false

Indicates if special query runner mode in which sql queries won't be executed is enabled.

Methods

clearSqlMemory

  • clearSqlMemory(): void

disableSqlMemory

  • disableSqlMemory(): void
  • Disables special query runner mode in which sql queries won't be executed started by calling enableSqlMemory() method.

    Previously memorized sql will be flushed.

    Returns void

enableSqlMemory

  • enableSqlMemory(): void
  • 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.

    Returns void

executeMemoryDownSql

  • executeMemoryDownSql(): Promise<void>

executeMemoryUpSql

  • executeMemoryUpSql(): Promise<void>

Protected executeQueries

Protected getCachedTable

  • getCachedTable(tableName: string): Promise<Table>

Protected getCachedView

  • getCachedView(viewName: string): Promise<View>

getMemorySql

getTable

  • getTable(tablePath: string): Promise<Table | undefined>

getTables

  • getTables(tableNames: string[]): Promise<Table[]>

Protected getTypeormMetadataTableName

  • getTypeormMetadataTableName(): string

getView

  • getView(viewPath: string): Promise<View | undefined>

getViews

  • getViews(viewPaths: string[]): Promise<View[]>

Protected isColumnChanged

  • isColumnChanged(oldColumn: TableColumn, newColumn: TableColumn, checkDefault?: boolean, checkComment?: boolean): boolean
  • Checks if at least one of column properties was changed. Does not checks column type, length and autoincrement, because these properties changes separately.

    Parameters

    Returns boolean

Protected isDefaultColumnLength

  • isDefaultColumnLength(table: Table, column: TableColumn, length: string): boolean

Protected isDefaultColumnPrecision

  • isDefaultColumnPrecision(table: Table, column: TableColumn, precision: number): boolean

Protected isDefaultColumnScale

  • isDefaultColumnScale(table: Table, column: TableColumn, scale: number): boolean

Protected isDefaultColumnWidth

  • isDefaultColumnWidth(table: Table, column: TableColumn, width: number): boolean

Protected Abstract loadTables

  • loadTables(tablePaths: string[]): Promise<Table[]>

Protected Abstract loadViews

  • loadViews(tablePaths: string[]): Promise<View[]>

Abstract query

  • query(query: string, parameters?: any[]): Promise<any>

Protected replaceCachedTable

  • replaceCachedTable(table: Table, changedTable: Table): void

Generated using TypeDoc