Updates
This commit is contained in:
parent
57e67f5c51
commit
d2fe98b4b8
3
dist/package-shared/utils/grab-db-names.js
vendored
3
dist/package-shared/utils/grab-db-names.js
vendored
@ -33,8 +33,7 @@ function grabDbNames(params) {
|
|||||||
throw new Error(`No Db Name Provided!`);
|
throw new Error(`No Db Name Provided!`);
|
||||||
const dbFullName = (0, grab_db_full_name_1.default)({
|
const dbFullName = (0, grab_db_full_name_1.default)({
|
||||||
dbName: dbSlug,
|
dbName: dbSlug,
|
||||||
user: params === null || params === void 0 ? void 0 : params.user,
|
userId: finalUserId,
|
||||||
userId: params === null || params === void 0 ? void 0 : params.userId,
|
|
||||||
});
|
});
|
||||||
if (!dbFullName)
|
if (!dbFullName)
|
||||||
throw new Error(`Couldn't grab DB full name!`);
|
throw new Error(`Couldn't grab DB full name!`);
|
||||||
|
|||||||
@ -14,6 +14,7 @@ function grabDSQLConnectionConfig(param) {
|
|||||||
const dbNames = (param === null || param === void 0 ? void 0 : param.noDb)
|
const dbNames = (param === null || param === void 0 ? void 0 : param.noDb)
|
||||||
? undefined
|
? undefined
|
||||||
: (0, grab_db_names_1.default)({ dbName: param === null || param === void 0 ? void 0 : param.database });
|
: (0, grab_db_names_1.default)({ dbName: param === null || param === void 0 ? void 0 : param.database });
|
||||||
|
console.log("dbNames", dbNames);
|
||||||
const config = Object.assign({ host: process.env.DSQL_DB_HOST, user: process.env.DSQL_DB_USERNAME, password: process.env.DSQL_DB_PASSWORD, database: dbNames === null || dbNames === void 0 ? void 0 : dbNames.dbFullName, port: process.env.DSQL_DB_PORT
|
const config = Object.assign({ host: process.env.DSQL_DB_HOST, user: process.env.DSQL_DB_USERNAME, password: process.env.DSQL_DB_PASSWORD, database: dbNames === null || dbNames === void 0 ? void 0 : dbNames.dbFullName, 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: CONN_TIMEOUT, connectTimeout: CONN_TIMEOUT, 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);
|
||||||
|
|||||||
@ -21,6 +21,7 @@ const grab_dsql_connection_config_1 = __importDefault(require("./grab-dsql-conne
|
|||||||
function grabDSQLConnection(param) {
|
function grabDSQLConnection(param) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const config = (0, grab_dsql_connection_config_1.default)(param);
|
const config = (0, grab_dsql_connection_config_1.default)(param);
|
||||||
|
console.log("config", config);
|
||||||
try {
|
try {
|
||||||
return yield mariadb_1.default.createConnection(config);
|
return yield mariadb_1.default.createConnection(config);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,8 +43,7 @@ export default function grabDbNames(params?: Param) {
|
|||||||
|
|
||||||
const dbFullName = grabDbFullName({
|
const dbFullName = grabDbFullName({
|
||||||
dbName: dbSlug,
|
dbName: dbSlug,
|
||||||
user: params?.user,
|
userId: finalUserId,
|
||||||
userId: params?.userId,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!dbFullName) throw new Error(`Couldn't grab DB full name!`);
|
if (!dbFullName) throw new Error(`Couldn't grab DB full name!`);
|
||||||
|
|||||||
@ -15,6 +15,8 @@ export default function grabDSQLConnectionConfig(
|
|||||||
? undefined
|
? undefined
|
||||||
: grabDbNames({ dbName: param?.database });
|
: grabDbNames({ dbName: param?.database });
|
||||||
|
|
||||||
|
console.log("dbNames", dbNames);
|
||||||
|
|
||||||
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,
|
||||||
|
|||||||
@ -11,6 +11,8 @@ export default async function grabDSQLConnection(
|
|||||||
): Promise<Connection> {
|
): Promise<Connection> {
|
||||||
const config = grabDSQLConnectionConfig(param);
|
const config = grabDSQLConnectionConfig(param);
|
||||||
|
|
||||||
|
console.log("config", config);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await mariadb.createConnection(config);
|
return await mariadb.createConnection(config);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/datasquirel",
|
"name": "@moduletrace/datasquirel",
|
||||||
"version": "5.3.8",
|
"version": "5.3.9",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -9,7 +9,8 @@
|
|||||||
"dsql-schema-to-typedef": "dist/engine/schema-to-typedef.js"
|
"dsql-schema-to-typedef": "dist/engine/schema-to-typedef.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "tsc --watch"
|
"dev": "tsc --watch",
|
||||||
|
"compile": "rm -rf dist && tsc && cp -r package-shared/data dist/package-shared/"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user