Repository navigation
connExt.Catalog.Class.CatalogConnExt
tedious-plus / connExt/Catalog / CatalogConnExt
Defined in: connExt/Catalog.ts:81
Catalog functions for a database connection.
This class is accessed via Connection.catalog.
Usage:
const pkColumns = await conn.catalog.getPrimaryKeyColumns("dbo.t1");
await conn.catalog.dropTable("#tmp", true);new CatalogConnExt(connection): CatalogConnExt;Defined in: connExt/Catalog.ts:88
Creates a CatalogConnExt object. Applications use Connection.catalog instead.
CatalogConnExt
dropTable(tableName, mayNotExist?): Promise<void>;Defined in: connExt/Catalog.ts:217
Drops a table.
string
The name of the table. It is inserted unchanged into the drop table statement.
boolean = false
true to ignore that the table does not exist.
Promise<void>
getPrimaryKeyColumns(table): Promise<IndexColumn[]>;Defined in: connExt/Catalog.ts:170
Returns the primary key columns of a table, in the order of the key.
The table name or a resolved table.
Promise<IndexColumn[]>
A promise for the primary key columns, or an empty array if the table has no primary key.
getPrimaryKeyColumnsSql(table): Promise<string>;Defined in: connExt/Catalog.ts:198
Returns the primary key columns of a table as an SQL column list, e.g. [c], [a] desc.
The column list can be used in an order by clause.
The table name or a resolved table.
Promise<string>
A promise for the column list, or an empty string if the table has no primary key.
resolveTable(tableName): Promise<ResolvedTable>;Defined in: connExt/Catalog.ts:130
Resolves a table name.
Supported are user-defined tables of the current database, tables of another database on the same server,
and temporary tables. The table name is written as in SQL, e.g. t1, dbo.t1, [otherDb].[dbo].[t1] or #t1.
string
The name of the table.
Promise<ResolvedTable>
A promise for the resolved table. The promise is rejected when the table does not exist or is not accessible.