UNPKG

node-jdbc-driver

Version:

This package is help to use jdbc connection

75 lines (74 loc) 2.53 kB
"use strict"; // Created database interface Object.defineProperty(exports, "__esModule", { value: true }); exports.QueryType = exports.db = void 0; var QueryType; (function (QueryType) { QueryType["columns"] = "C"; QueryType["describe"] = "D"; })(QueryType || (exports.QueryType = QueryType = {})); var db = { driverPath: '../drivers/', hive: { jar: 'hive-jdbc-uber-2.6.3.0-235.jar', connectionType: 'hive2', className: 'org.apache.hive.jdbc.HiveDriver', version: '2.6.3.0-235', query: { columns: function (tableName) { return "DESCRIBE ".concat(tableName); }, describe: function (tableName) { return "SHOW tblproperties ".concat(tableName); }, } }, postgresql: { jar: 'postgresql-42.6.0.jar', connectionType: 'postgresql', className: 'org.postgresql.Driver', version: '42.6.0', query: { columns: function (tableName) { return "SELECT column_name as col_name, data_type FROM information_schema.columns WHERE table_name = '".concat(tableName, "'"); }, describe: function (tableName) { return "SELECT count(*) as total_rows, pg_size_pretty( pg_total_relation_size('".concat(tableName, "') ) as total_size;"); }, } }, sqlite: { jar: 'sqlite-jdbc-3.7.2.jar', className: 'org.sqlite.JDBC', connectionType: 'sqlite', version: '3.7.2', query: { columns: function (tableName) { return "PRAGMA table_info(".concat(tableName, ")"); }, describe: function (tableName) { return "PRAGMA table_info(".concat(tableName, ")"); }, } }, tibero: { jar: 'tibero7-jdbc.jar', className: 'com.tmax.tibero.jdbc.TbDriver', connectionType: 'tibero:thin', version: '7', query: { columns: function (tableName) { return "DESCRIBE ".concat(tableName); }, describe: function (tableName) { return "SHOW tblproperties ".concat(tableName); }, } }, getJar: function (type) { if (this[type]) { return this.driverPath + this[type].jar; } else { return ''; } }, getDriver: function (type) { if (this[type]) { return this[type]; } else { return { jar: '', className: '', connectionType: '', version: '' }; } } }; exports.db = db;