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