Skip to content

Commit

Permalink
Update types and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jung-thomas committed Sep 8, 2023
1 parent 707c83e commit 8fb9a06
Show file tree
Hide file tree
Showing 15 changed files with 228 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"New Node.js minimum version of 18. [16 is end of life](https://nodejs.org/en/blog/announcements/nodejs16-eol)",
"Load HANA Connection via CDS Env API and profile Hybrid instead of direct binding with cds-dk",
"cds bind based connections are MUCH faster after the first call",
"PostgresSQL and SQLite support on key commands thanks to CDS abstraction"
"PostgresSQL and SQLite support on key commands thanks to CDS abstraction",
"Commands: tables and querySimple support profile based access and db abstraction"
]
},
{
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [3.202309.1] - 2023-09-06

**Changed**

- [CAP version 7.2.0](https://cap.cloud.sap/docs/releases/aug23)
- New Node.js minimum version of 18. [16 is end of life](https://nodejs.org/en/blog/announcements/nodejs16-eol)
- Load HANA Connection via CDS Env API and profile Hybrid instead of direct binding with cds-dk
- cds bind based connections are MUCH faster after the first call
- PostgresSQL and SQLite support on key commands thanks to CDS abstraction
- Commands: tables and querySimple support profile based access and db abstraction

## [3.202308.1] - 2023-08-25

**Changed**
Expand Down
1 change: 0 additions & 1 deletion bin/cds.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-check
import * as base from '../utils/base.js'
import * as dbInspect from '../utils/dbInspect.js'
//import * as conn from '../utils/connections.js'
Expand Down
2 changes: 1 addition & 1 deletion types/bin/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export function init(): Promise<(typeof import("./containers.js") | typeof import("./dataTypes.js") | typeof import("./featureUsage.js") | typeof import("./functions.js") | typeof import("./hanaCloudHDIInstances.js") | typeof import("./indexes.js") | typeof import("./inspectTable.js") | typeof import("./querySimple.js") | typeof import("./hanaCloudSBSSInstances.js") | typeof import("./schemas.js") | typeof import("./hanaCloudSchemaInstances.js") | typeof import("./hanaCloudSecureStoreInstances.js") | typeof import("./tables.js") | typeof import("./hanaCloudUPSInstances.js") | typeof import("./version.js") | typeof import("./activateHDI.js") | typeof import("./adminHDI.js") | typeof import("./adminHDIGroup.js") | typeof import("./callProcedure.js") | typeof import("./certificates.js") | typeof import("./cds.js") | typeof import("./openChangeLog.js") | typeof import("./changeLog.js") | typeof import("./changeLogUI.js") | typeof import("./connect.js") | typeof import("./containersUI.js") | typeof import("./copy2DefaultEnv.js") | typeof import("./copy2Env.js") | typeof import("./copy2Secrets.js") | typeof import("./createContainer.js") | typeof import("./createGroup.js") | typeof import("./createContainerUsers.js") | typeof import("./createJWT.js") | typeof import("./createModule.js") | typeof import("./createXSAAdmin.js") | typeof import("./dataTypesUI.js") | typeof import("./dataVolumes.js") | typeof import("./disks.js") | typeof import("./dropContainer.js") | typeof import("./dropGroup.js") | typeof import("./features.js") | typeof import("./featuresUI.js") | typeof import("./featureUsageUI.js") | typeof import("./functionsUI.js") | typeof import("./hanaCloudHDIInstancesUI.js") | typeof import("./hanaCloudInstances.js") | typeof import("./hanaCloudStart.js") | typeof import("./hanaCloudStop.js") | typeof import("./hdbsql.js") | typeof import("./hostInformation.js") | typeof import("./indexesUI.js") | typeof import("./iniContents.js") | typeof import("./iniFiles.js") | typeof import("./inspectFunction.js") | typeof import("./inspectIndex.js") | typeof import("./inspectJWT.js") | typeof import("./inspectLibMember.js") | typeof import("./inspectLibrary.js") | typeof import("./inspectProcedure.js") | typeof import("./inspectTableUI.js") | typeof import("./inspectTrigger.js") | typeof import("./inspectUser.js") | typeof import("./inspectView.js") | typeof import("./libraries.js") | typeof import("./massConvert.js") | typeof import("./massConvertUI.js") | typeof import("./massRename.js") | typeof import("./massUsers.js") | typeof import("./matrix.js") | typeof import("./objects.js") | typeof import("./openBAS.js") | typeof import("./openDBExplorer.js") | typeof import("./ports.js") | typeof import("./privilegeError.js") | typeof import("./procedures.js") | typeof import("./querySimpleUI.js") | typeof import("./readMe.js") | typeof import("./readMeUI.js") | typeof import("./openReadMe.js") | typeof import("./reclaim.js") | typeof import("./rick.js") | typeof import("./roles.js") | typeof import("./hanaCloudSBSSInstancesUI.js") | typeof import("./schemasUI.js") | typeof import("./hanaCloudSchemaInstancesUI.js") | typeof import("./hanaCloudSecureStoreInstancesUI.js") | typeof import("./connectViaServiceKey.js") | typeof import("./sequences.js") | typeof import("./status.js") | typeof import("./synonyms.js") | typeof import("./systemInfo.js") | typeof import("./systemInfoUI.js") | typeof import("./tablesUI.js") | typeof import("./traces.js") | typeof import("./traceContents.js") | typeof import("./triggers.js") | typeof import("./UI.js") | typeof import("./hanaCloudUPSInstancesUI.js") | typeof import("./users.js") | typeof import("./views.js") | typeof import("./btp.js") | typeof import("./btpSubs.js") | typeof import("./btpInfo.js") | typeof import("./issue.js"))[]>;
export function init(): Promise<(typeof import("./containers.js") | typeof import("./dataTypes.js") | typeof import("./featureUsage.js") | typeof import("./functions.js") | typeof import("./hanaCloudHDIInstances.js") | typeof import("./indexes.js") | typeof import("./inspectTable.js") | typeof import("./querySimple.js") | typeof import("./hanaCloudSBSSInstances.js") | typeof import("./schemas.js") | typeof import("./hanaCloudSchemaInstances.js") | typeof import("./hanaCloudSecureStoreInstances.js") | typeof import("./tables.js") | typeof import("./tablesPG.js") | typeof import("./tablesSQLite.js") | typeof import("./hanaCloudUPSInstances.js") | typeof import("./version.js") | typeof import("./activateHDI.js") | typeof import("./adminHDI.js") | typeof import("./adminHDIGroup.js") | typeof import("./callProcedure.js") | typeof import("./certificates.js") | typeof import("./cds.js") | typeof import("./openChangeLog.js") | typeof import("./changeLog.js") | typeof import("./changeLogUI.js") | typeof import("./connect.js") | typeof import("./containersUI.js") | typeof import("./copy2DefaultEnv.js") | typeof import("./copy2Env.js") | typeof import("./copy2Secrets.js") | typeof import("./createContainer.js") | typeof import("./createGroup.js") | typeof import("./createContainerUsers.js") | typeof import("./createJWT.js") | typeof import("./createModule.js") | typeof import("./createXSAAdmin.js") | typeof import("./dataTypesUI.js") | typeof import("./dataVolumes.js") | typeof import("./disks.js") | typeof import("./dropContainer.js") | typeof import("./dropGroup.js") | typeof import("./features.js") | typeof import("./featuresUI.js") | typeof import("./featureUsageUI.js") | typeof import("./functionsUI.js") | typeof import("./hanaCloudHDIInstancesUI.js") | typeof import("./hanaCloudInstances.js") | typeof import("./hanaCloudStart.js") | typeof import("./hanaCloudStop.js") | typeof import("./hdbsql.js") | typeof import("./hostInformation.js") | typeof import("./indexesUI.js") | typeof import("./iniContents.js") | typeof import("./iniFiles.js") | typeof import("./inspectFunction.js") | typeof import("./inspectIndex.js") | typeof import("./inspectJWT.js") | typeof import("./inspectLibMember.js") | typeof import("./inspectLibrary.js") | typeof import("./inspectProcedure.js") | typeof import("./inspectTableUI.js") | typeof import("./inspectTrigger.js") | typeof import("./inspectUser.js") | typeof import("./inspectView.js") | typeof import("./libraries.js") | typeof import("./massConvert.js") | typeof import("./massConvertUI.js") | typeof import("./massRename.js") | typeof import("./massUsers.js") | typeof import("./matrix.js") | typeof import("./objects.js") | typeof import("./openBAS.js") | typeof import("./openDBExplorer.js") | typeof import("./ports.js") | typeof import("./privilegeError.js") | typeof import("./procedures.js") | typeof import("./querySimpleUI.js") | typeof import("./readMe.js") | typeof import("./readMeUI.js") | typeof import("./openReadMe.js") | typeof import("./reclaim.js") | typeof import("./rick.js") | typeof import("./roles.js") | typeof import("./hanaCloudSBSSInstancesUI.js") | typeof import("./schemasUI.js") | typeof import("./hanaCloudSchemaInstancesUI.js") | typeof import("./hanaCloudSecureStoreInstancesUI.js") | typeof import("./connectViaServiceKey.js") | typeof import("./sequences.js") | typeof import("./status.js") | typeof import("./synonyms.js") | typeof import("./systemInfo.js") | typeof import("./systemInfoUI.js") | typeof import("./tablesUI.js") | typeof import("./traces.js") | typeof import("./traceContents.js") | typeof import("./triggers.js") | typeof import("./UI.js") | typeof import("./hanaCloudUPSInstancesUI.js") | typeof import("./users.js") | typeof import("./views.js") | typeof import("./btp.js") | typeof import("./btpSubs.js") | typeof import("./btpInfo.js") | typeof import("./issue.js"))[]>;
1 change: 1 addition & 0 deletions types/bin/inspectView.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export function handler(argv: any): void;
export function viewInspect(prompts: any): Promise<{
basic: any;
parameters: any;
fields: any;
sql: string;
cds: string;
Expand Down
10 changes: 10 additions & 0 deletions types/bin/querySimple.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,14 @@ export namespace inputPrompts {
let required_3: boolean;
export { required_3 as required };
}
namespace profile {
let description_4: string;
export { description_4 as description };
let type_4: string;
export { type_4 as type };
let required_4: boolean;
export { required_4 as required };
export function ask_1(): void;
export { ask_1 as ask };
}
}
18 changes: 16 additions & 2 deletions types/bin/tables.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
export function handler(argv: any): void;
export function getTables(prompts: any): Promise<any>;
export function handler(argv: any): Promise<void>;
export function getTables(prompts: any): Promise<{
SCHEMA_NAME?: string;
TABLE_NAME: string;
TABLE_OID?: string;
COMMENTS?: string;
}[]>;
export const command: "tables [schema] [table]";
export const aliases: string[];
export const describe: string;
Expand All @@ -26,4 +31,13 @@ export namespace inputPrompts {
let required_2: boolean;
export { required_2 as required };
}
namespace profile {
let description_3: string;
export { description_3 as description };
let type_3: string;
export { type_3 as type };
let required_3: boolean;
export { required_3 as required };
export function ask(): void;
}
}
28 changes: 28 additions & 0 deletions types/bin/tablesPG.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export function handler(argv: any): void;
export const command: "tablesPG [schema] [table]";
export const aliases: string[];
export const describe: string;
export const builder: import("yargs").CommandBuilder<{}, {}>;
export namespace inputPrompts {
namespace table {
let description: string;
let type: string;
let required: boolean;
}
namespace schema {
let description_1: string;
export { description_1 as description };
let type_1: string;
export { type_1 as type };
let required_1: boolean;
export { required_1 as required };
}
namespace profile {
let description_2: string;
export { description_2 as description };
let type_2: string;
export { type_2 as type };
let required_2: boolean;
export { required_2 as required };
}
}
20 changes: 20 additions & 0 deletions types/bin/tablesSQLite.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export function handler(argv: any): void;
export const command: "tablesSQLite [table]";
export const aliases: string[];
export const describe: string;
export const builder: import("yargs").CommandBuilder<{}, {}>;
export namespace inputPrompts {
namespace table {
let description: string;
let type: string;
let required: boolean;
}
namespace profile {
let description_1: string;
export { description_1 as description };
let type_1: string;
export { type_1 as type };
let required_1: boolean;
export { required_1 as required };
}
}
6 changes: 6 additions & 0 deletions types/utils/database/hanaCDS.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default class _default extends DBClientClass {
constructor(prompts: any, optionsCDS: any);
listTables(): Promise<any>;
#private;
}
import DBClientClass from "./index.js";
8 changes: 8 additions & 0 deletions types/utils/database/hanaDirect.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default class _default extends DBClientClass {
constructor(prompts: any);
connect(): Promise<import("sap-hdb-promisfied").default>;
listTables(): Promise<any>;
execSQL(query: any): Promise<any>;
#private;
}
import DBClientClass from "./index.js";
95 changes: 95 additions & 0 deletions types/utils/database/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/**
* Database Client Abstract Super Class
* @class
* @constructor
* @public
* @classdesc Database Client Abstract Level
*/
export default class dbClientClass {
/**
* Static Factory Method to initialize the DB Client in your selected Flavor
* @param {object} prompts - processed input prompts
* @returns {Promise<dbClientClass>} childClass - flavor specific DB client class instance
*/
static getNewClient(prompts: object): Promise<dbClientClass>;
/**
* Create an instance of the database client specific to the prompt profile
* @param {typeof import("prompt")} prompts - input prompts current value
*/
constructor(prompts: any, optionsCDS: any);
/**
* Connect to the target database
* @returns {Promise<object>} cds connection object
*/
connect(): Promise<object>;
/**
* Disconnect from the target database
*/
disconnect(): void;
/**
* Connect to the target database and set a specific Schema
* @param {String} schema - Database Schema name
* @returns {Promise<object>} cds connection object
*/
connectTargetSchema(schema: string): Promise<object>;
/**
* Database specific wildcard handling
* @param {String} input - database object name that needs wildcard handling
*/
adjustWildcard(input: string): string;
/**
* TableData as JSON
* @typedef {Object} TableLine
* @property {String} [SCHEMA_NAME]
* @property {String} TABLE_NAME
* @property {String} [TABLE_OID]
* @property {String} [COMMENTS]
*/
/**
* TableData as JSON
* @typedef {Array.<TableLine>} TableData
*/
/**
* return a list of database tables
* @returns {Promise<TableData>} table of database tables
*/
listTables(): Promise<{
SCHEMA_NAME?: string;
TABLE_NAME: string;
TABLE_OID?: string;
COMMENTS?: string;
}[]>;
/**
* Execute single SQL Statement and directly return result set
* @param {string} sql - SQL Statement
* @returns {Promise<any>} - result set object
*/
execSQL(query: any): Promise<any>;
/**
* Getter for Prompts Private Attribute
* @returns {typeof import("prompt")} prompts - input prompts current value
*/
getPrompts(): any;
/**
* Getter for CDS or HDB database object Private Attribute
* @returns @type {Object}
*/
getDB(): any;
/**
* Getter for database kind/flavor Private Attribute
* @returns @type {String} Database Kind / Flavor
*/
getKind(): any;
/**
* Setter for CDS or HDB database object Private Attribute
* @param @type {Object} db
*/
setDB(db: any): void;
/**
* From Input parameters, calculate the schema that should be used for the rest of this operation
* @param @type {typeof import("prompt")} prompts - input prompts current value
* @param @type {Object} optionsCDS - CDS based Connection Options
*/
schemaCalculation(prompts: any, optionsCDS: any): string;
#private;
}
6 changes: 6 additions & 0 deletions types/utils/database/postgres.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default class _default extends DBClientClass {
constructor(prompts: any, optionsCDS: any);
listTables(): Promise<any>;
#private;
}
import DBClientClass from "./index.js";
6 changes: 6 additions & 0 deletions types/utils/database/sqlite.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default class _default extends DBClientClass {
constructor(prompts: any, optionsCDS: any);
listTables(): Promise<any>;
#private;
}
import DBClientClass from "./index.js";
19 changes: 18 additions & 1 deletion types/utils/dbInspect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ export function getCalcViewFields(db: object, schema: string, viewId: string, vi
* @returns {Promise<object>}
*/
export function getViewFields(db: object, viewOid: string): Promise<object>;
/**
* Get View Parameters and Metadata
* @param {object} db - Database Connection
* @param {string} schema - Schema
* @param {string} viewId - View Unique ID
* @param {string} viewOid - View Unique ID
* @returns {Promise<object>}
*/
export function getCalcViewParameters(db: object, schema: string, viewId: string, viewOid: string): Promise<object>;
/**
* Get View Parameters and Metadata
* @param {object} db - Database Connection
* @param {string} viewOid - View Unique ID
* @returns {Promise<object>}
*/
export function getViewParameters(db: object, viewOid: string): Promise<object>;
/**
* Get DB Table Details
* @param {object} db - Database Connection
Expand Down Expand Up @@ -114,9 +130,10 @@ export function getFunctionPramCols(db: object, funcOid: string): Promise<object
* @param {string} type - DB Object type
* @param {string} [schema] - Schema
* @param {string} [parent] - Calling context which impacts formatting
* @param {object} [parameters] - View Parameters
* @returns {Promise<string>}
*/
export function formatCDS(db: object, object: object, fields: object, constraints: object, type: string, schema?: string, parent?: string): Promise<string>;
export function formatCDS(db: object, object: object, fields: object, constraints: object, type: string, schema?: string, parent?: string, parameters?: object): Promise<string>;
/**
* Get Geo Columns requires special lookup and details
* @param {object} db - Database Connection
Expand Down

0 comments on commit 8fb9a06

Please sign in to comment.