Updates
This commit is contained in:
parent
e8787a2ef8
commit
da87fe6491
@ -20,10 +20,11 @@ const grabDbSSL_1 = __importDefault(require("./backend/grabDbSSL"));
|
||||
*/
|
||||
function grabDSQLConnection(param) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const CONN_TIMEOUT = 10000;
|
||||
const config = Object.assign({ host: process.env.DSQL_DB_HOST, user: process.env.DSQL_DB_USERNAME, password: process.env.DSQL_DB_PASSWORD, database: (param === null || param === void 0 ? void 0 : param.database) ||
|
||||
((param === null || param === void 0 ? void 0 : param.noDb) ? undefined : process.env.DSQL_DB_NAME), port: process.env.DSQL_DB_PORT
|
||||
? Number(process.env.DSQL_DB_PORT)
|
||||
: undefined, charset: "utf8mb4", ssl: (0, grabDbSSL_1.default)(), bigIntAsNumber: true, supportBigNumbers: true, bigNumberStrings: false, dateStrings: true, metaAsArray: true, socketTimeout: 5000, connectTimeout: 5000, compress: true }, param === null || param === void 0 ? void 0 : param.config);
|
||||
: undefined, charset: "utf8mb4", ssl: (0, grabDbSSL_1.default)(), bigIntAsNumber: true, supportBigNumbers: true, bigNumberStrings: false, dateStrings: true, metaAsArray: true, socketTimeout: CONN_TIMEOUT, connectTimeout: CONN_TIMEOUT, compress: true }, param === null || param === void 0 ? void 0 : param.config);
|
||||
try {
|
||||
return yield mariadb_1.default.createConnection(config);
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ type Param = {
|
||||
export default async function grabDSQLConnection(
|
||||
param?: Param
|
||||
): Promise<Connection> {
|
||||
const CONN_TIMEOUT = 10000;
|
||||
|
||||
const config: ConnectionConfig = {
|
||||
host: process.env.DSQL_DB_HOST,
|
||||
user: process.env.DSQL_DB_USERNAME,
|
||||
@ -39,8 +41,8 @@ export default async function grabDSQLConnection(
|
||||
bigNumberStrings: false,
|
||||
dateStrings: true,
|
||||
metaAsArray: true,
|
||||
socketTimeout: 5000,
|
||||
connectTimeout: 5000,
|
||||
socketTimeout: CONN_TIMEOUT,
|
||||
connectTimeout: CONN_TIMEOUT,
|
||||
compress: true,
|
||||
...param?.config,
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@moduletrace/datasquirel",
|
||||
"version": "4.9.3",
|
||||
"version": "4.9.4",
|
||||
"description": "Cloud-based SQL data management tool",
|
||||
"main": "dist/index.js",
|
||||
"bin": {
|
||||
|
Loading…
Reference in New Issue
Block a user