Db
Defined in: js-api/src/data.ts:103
Constructors
Constructor
new Db():
Db
Returns
Db
Methods
buildMutation()
buildMutation(
connectionId,tableName):TableMutationBuilder
Defined in: js-api/src/data.ts:135
Creates a TableMutationBuilder for fluent UPDATE/DELETE composition.
Parameters
| Parameter | Type | Description |
|---|---|---|
connectionId | string | fully-qualified connection name (see [nqName]) |
tableName | string | database table name |
Returns
buildQuery()
buildQuery(
connectionId,tableName):TableQueryBuilder
Defined in: js-api/src/data.ts:120
Creates TableQueryBuilder that can be used to construct sql queries.
Parameters
| Parameter | Type | Description |
|---|---|---|
connectionId | string | fully-qualified connection name (see [nqName]) |
tableName | string | database table name |
Returns
ddl()
ddl(
connectionId):DdlBuilder
Defined in: js-api/src/data.ts:144
Creates a DdlBuilder for structured DDL (create/alter/drop tables, indexes,
keys) against the [connectionId] connection. Every operation supports dryRun()
(the exact SQL plus live-data destructive pre-checks) and the
confirmDestructive execution contract — see DdlCommand.
Parameters
| Parameter | Type | Description |
|---|---|---|
connectionId | string | fully-qualified connection name (see [nqName]) |
Returns
getInfo()
getInfo(
connection,catalog?):Promise<DbInfo[]>
Defined in: js-api/src/data.ts:153
Returns database catalog (e.g. database) information for the given connection. If catalog is specified, returns only the matching catalog. For databases that don't support catalogs (e.g., MySQL, Oracle), returns a single DbInfo with the name from the connection's db property, or '<unknown database name>' if not set.
Parameters
| Parameter | Type | Default value |
|---|---|---|
connection | DataConnection | undefined |
catalog | string | null | null |
Returns
Promise<DbInfo[]>
query()
query(
connectionId,sql):Promise<DataFrame>
Defined in: js-api/src/data.ts:109
Executes a specified sql against the specified connectionId.
Parameters
| Parameter | Type | Description |
|---|---|---|
connectionId | string | fully-qualified connection name (see [nqName]) |
sql | string | SQL statement |
Returns
Promise<DataFrame>
table()
table(
connectionId,tableName):DbTable
Defined in: js-api/src/data.ts:128
Returns a DbTable for structured writes (insert/upsert/update/delete) against [tableName] on the [connectionId] connection.
Parameters
| Parameter | Type | Description |
|---|---|---|
connectionId | string | fully-qualified connection name (see [nqName]) |
tableName | string | database table name (optionally schema-qualified, e.g. public.orders) |