node-jdbc-firebird
Version:
This package is help to use jdbc connection
49 lines (48 loc) • 2.1 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var database_1 = __importDefault(require("./database"));
var Drivers = /** @class */ (function (_super) {
__extends(Drivers, _super);
function Drivers(type, config) {
var _a;
var _this = _super.call(this, type, config) || this;
_this.regex = /(\d+(\.\d+)+-\d+|\d+(\.\d+)+)/;
console.log(type);
if (type === 'custom') {
console.log('Custom driver');
var _config = config;
_this.set_driver({
jar: _config.jars.split('/').pop() || _config.jars,
className: _config.driverClass,
connectionType: _config.driverClass.split('.')[1],
version: ((_a = _config.jars.match(_this.regex)) === null || _a === void 0 ? void 0 : _a[1]) || '',
query: {
columns: function (tableName) { return ''; },
describe: function (tableName) { return ''; },
}
});
_this.set_driver_path(_config.jars);
}
return _this;
}
return Drivers;
}(database_1.default));
exports.default = Drivers;