hana-cli
Version:
HANA Developer Command Line Interface
33 lines (30 loc) • 1.24 kB
JavaScript
import DBClientClass from "./index.js"
import * as base from '../base.js'
export default class extends DBClientClass {
constructor(prompts, optionsCDS) {
super(prompts, optionsCDS)
base.debug(base.bundle.getText("debug.dbClientSpecificProfile", [prompts.profile]))
this.
}
async listTables() {
base.debug(base.bundle.getText("debug.dbListTablesForClient", [this.
const prompts = super.getPrompts()
prompts.limit = base.validateLimit(prompts.limit)
const tableName = super.adjustWildcard(prompts.table)
let dbQuery = SELECT
.columns("SCHEMA_NAME", "TABLE_NAME",
{ref:["TABLE_OID"], as:'TABLE_OID', cast: {type:"cds.String"}},"COMMENTS" )
.from("TABLES")
.where({ SCHEMA_NAME: {like: this.
.orderBy("SCHEMA_NAME", "TABLE_NAME")
.limit(prompts.limit)
if (prompts.debug) {
base.debug(JSON.stringify(dbQuery))
}
let db = this.getDB()
let results = await db.run(dbQuery)
return results
}
}