Db
Constructors
new Db()
new Db():
Db
Returns
Methods
buildQuery()
buildQuery(
connectionId,tableName):TableQueryBuilder
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
Source
getInfo()
getInfo(
connection,catalog):Promise<DbInfo[]>
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 | null | string | null |
Returns
Promise <DbInfo[]>
Source
query()
query(
connectionId,sql):Promise<DataFrame>
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>