dsql-admin/dsql-app/init/init-sql/(functions)/create-databases.ts

16 lines
481 B
TypeScript
Raw Normal View History

2025-01-13 08:00:21 +00:00
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"
);
}
}