@saptools/cf-hana 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +47 -15
- package/dist/cli.js +1025 -85
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.js +531 -57
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ type StatementKind = "select" | "dml" | "ddl" | "unknown";
|
|
|
7
7
|
/** Which HANA user from a service binding to authenticate as. */
|
|
8
8
|
type DbUserRole = "runtime" | "hdi";
|
|
9
9
|
/** Where resolved credentials came from. */
|
|
10
|
-
type CredentialSource = "
|
|
10
|
+
type CredentialSource = "live";
|
|
11
11
|
/** Output rendering for CLI results. */
|
|
12
12
|
type OutputFormat = "table" | "json" | "csv";
|
|
13
13
|
interface QueryResultColumn {
|
|
@@ -96,7 +96,7 @@ interface HanaClientInfo {
|
|
|
96
96
|
readonly credentialSource: CredentialSource;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
type WriteBackupOperation = "update" | "delete";
|
|
99
|
+
type WriteBackupOperation = "update" | "upsert" | "delete";
|
|
100
100
|
interface WriteBackupPlan {
|
|
101
101
|
readonly operation: WriteBackupOperation;
|
|
102
102
|
readonly statementSql: string;
|
|
@@ -107,6 +107,7 @@ interface SqlBackupWriteInput {
|
|
|
107
107
|
readonly operation: WriteBackupOperation;
|
|
108
108
|
readonly statementSql: string;
|
|
109
109
|
readonly result: QueryResult;
|
|
110
|
+
readonly selector?: string;
|
|
110
111
|
}
|
|
111
112
|
interface SqlBackupWriteOptions {
|
|
112
113
|
readonly now?: Date;
|
|
@@ -116,12 +117,19 @@ interface SqlBackupRecord {
|
|
|
116
117
|
readonly directory: string;
|
|
117
118
|
readonly statementPath: string;
|
|
118
119
|
readonly backupPath: string;
|
|
120
|
+
readonly metadataPath: string;
|
|
119
121
|
readonly rowCount: number;
|
|
120
122
|
}
|
|
121
123
|
declare function cfHanaBackupRoot(saptoolsRoot?: string): string;
|
|
122
124
|
declare function buildWriteBackupPlan(sql: string, params?: readonly SqlParam[]): WriteBackupPlan | undefined;
|
|
123
125
|
declare function writeSqlBackup(input: SqlBackupWriteInput, options?: SqlBackupWriteOptions): Promise<SqlBackupRecord>;
|
|
124
126
|
|
|
127
|
+
interface CatalogObjectInfo {
|
|
128
|
+
readonly schema: string;
|
|
129
|
+
readonly name: string;
|
|
130
|
+
readonly type: "TABLE" | "VIEW";
|
|
131
|
+
}
|
|
132
|
+
|
|
125
133
|
interface DriverExecResult {
|
|
126
134
|
readonly rows: readonly Record<string, SqlParam>[];
|
|
127
135
|
readonly columns: readonly QueryResultColumn[];
|
|
@@ -263,6 +271,8 @@ declare class HanaClient {
|
|
|
263
271
|
listSchemas(): Promise<readonly string[]>;
|
|
264
272
|
/** List the tables in a schema. */
|
|
265
273
|
listTables(schema: string): Promise<readonly TableInfo[]>;
|
|
274
|
+
/** List table and view names in a schema for typo suggestions. */
|
|
275
|
+
listCatalogObjects(schema: string): Promise<readonly CatalogObjectInfo[]>;
|
|
266
276
|
/** List the columns of a table. */
|
|
267
277
|
listColumns(schema: string, table: string): Promise<readonly ColumnInfo[]>;
|
|
268
278
|
/** Return the HANA execution plan for a statement. */
|
|
@@ -344,4 +354,4 @@ declare class DestructiveStatementError extends CfHanaError {
|
|
|
344
354
|
/** Narrow an unknown thrown value to a human-readable message. */
|
|
345
355
|
declare function errorMessage(error: unknown): string;
|
|
346
356
|
|
|
347
|
-
export { type BuiltStatement, CfHanaError, type CfHanaErrorCode, type ColumnInfo, type ConnectOptions, type CredentialSource, CredentialsNotFoundError, type DbUserRole, DestructiveStatementError, type DriverConnectParams, type DriverConnection, type DriverExecResult, HanaClient, type HanaClientInfo, type HanaDriver, type OutputFormat, type PoolOptions, QueryError, type QueryOptions, type QueryResult, type QueryResultColumn, type QueryRow, ReadOnlyViolationError, type SelectSpec, type SqlBackupRecord, type SqlBackupWriteInput, type SqlBackupWriteOptions, type SqlParam, type StatementKind, type TableInfo, Transaction, type WriteBackupOperation, type WriteBackupPlan, buildCount, buildDelete, buildInsert, buildSelect, buildUpdate, buildWriteBackupPlan, cfHanaBackupRoot, connect, createDriver, errorMessage, formatCsv, formatJson, formatResult, formatTable, query, withConnection, writeSqlBackup };
|
|
357
|
+
export { type BuiltStatement, type CatalogObjectInfo, CfHanaError, type CfHanaErrorCode, type ColumnInfo, type ConnectOptions, type CredentialSource, CredentialsNotFoundError, type DbUserRole, DestructiveStatementError, type DriverConnectParams, type DriverConnection, type DriverExecResult, HanaClient, type HanaClientInfo, type HanaDriver, type OutputFormat, type PoolOptions, QueryError, type QueryOptions, type QueryResult, type QueryResultColumn, type QueryRow, ReadOnlyViolationError, type SelectSpec, type SqlBackupRecord, type SqlBackupWriteInput, type SqlBackupWriteOptions, type SqlParam, type StatementKind, type TableInfo, Transaction, type WriteBackupOperation, type WriteBackupPlan, buildCount, buildDelete, buildInsert, buildSelect, buildUpdate, buildWriteBackupPlan, cfHanaBackupRoot, connect, createDriver, errorMessage, formatCsv, formatJson, formatResult, formatTable, query, withConnection, writeSqlBackup };
|