16 lines
481 B
TypeScript
16 lines
481 B
TypeScript
import dsql from "@moduletrace/datasquirel";
|
|
|
|
export default async function initSQLCreateDatabases() {
|
|
const checkDatasquirelDatabase = await dsql.utils.connDbHandler<any[]>(
|
|
global.INIT_SQL_MAIN_DB_CONN,
|
|
"SHOW DATABASES LIKE 'datasquirel'"
|
|
);
|
|
|
|
if (!checkDatasquirelDatabase?.[0]) {
|
|
const createDsqlDatabase = await dsql.utils.connDbHandler(
|
|
global.INIT_SQL_MAIN_DB_CONN,
|
|
"CREATE DATABASE datasquirel"
|
|
);
|
|
}
|
|
}
|