UNPKG

hana-cli

Version:
30 lines (25 loc) 1.1 kB
// @ts-check import * as baseLite from '../utils/base-lite.js' import { buildDocEpilogue } from '../utils/doc-linker.js' export const command = 'dataTypes' export const aliases = ['dt', 'datatypes', 'dataType', 'datatype'] export const describe = baseLite.bundle.getText("dataTypes") export const builder = (yargs) => yargs.options(baseLite.getBuilder({})).wrap(160).example('hana-cli dataTypes', baseLite.bundle.getText("dataTypesExample")).wrap(160).epilog(buildDocEpilogue('dataTypes', 'schema-tools', ['dataTypesUI', 'tables'])) export async function handler (argv) { const base = await import('../utils/base.js') base.promptHandler(argv, dbStatus, {}) } export async function dbStatus(prompts) { const base = await import('../utils/base.js') base.debug('dbStatus') try { base.setPrompts(prompts) const dbStatus = await base.createDBConnection() let results = await dbStatus.execSQL(`SELECT TYPE_NAME, COLUMN_SIZE, CREATE_PARAMS FROM DATA_TYPES `) base.outputTableFancy(results) base.end() return results } catch (error) { await base.error(error) } }