This commit is contained in:
Tben 2023-08-12 15:21:53 +01:00
parent 320a271e10
commit b72e7b27f1
2 changed files with 1 additions and 10 deletions

View File

@ -36,10 +36,8 @@ async function createDbFromSchema(dbSchema) {
* *
* @description Grab Schema * @description Grab Schema
*/ */
console.log("Starting createDbFromSchema ...");
if (!dbSchema || !Array.isArray(dbSchema) || !dbSchema[0]) { if (!dbSchema || !Array.isArray(dbSchema) || !dbSchema[0]) {
console.log("Invalid DB schema data");
return; return;
} }
@ -48,8 +46,6 @@ async function createDbFromSchema(dbSchema) {
const database = dbSchema[i]; const database = dbSchema[i];
const { dbFullName, tables } = database; const { dbFullName, tables } = database;
console.log("Now constructing database =>", database?.dbFullName);
//////////////////////////////////////// ////////////////////////////////////////
//////////////////////////////////////// ////////////////////////////////////////
//////////////////////////////////////// ////////////////////////////////////////
@ -57,8 +53,6 @@ async function createDbFromSchema(dbSchema) {
/** @type {{ dbFullName: string }[] | null} */ /** @type {{ dbFullName: string }[] | null} */
const dbCheck = await noDatabaseDbHandler({ query: `SELECT SCHEMA_NAME AS dbFullName FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '${dbFullName}'` }); const dbCheck = await noDatabaseDbHandler({ query: `SELECT SCHEMA_NAME AS dbFullName FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '${dbFullName}'` });
console.log("DB CHeck =>", dbCheck);
if (dbCheck && dbCheck[0]?.dbFullName) { if (dbCheck && dbCheck[0]?.dbFullName) {
// Database Exists // Database Exists
} else { } else {

View File

@ -1,14 +1,11 @@
{ {
"name": "datasquirel", "name": "datasquirel",
"version": "1.5.2", "version": "1.5.3",
"description": "Cloud-based SQL data management tool", "description": "Cloud-based SQL data management tool",
"main": "index.js", "main": "index.js",
"bin": { "bin": {
"dsql-watch": "./engine/dsql.js" "dsql-watch": "./engine/dsql.js"
}, },
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/BenjaminToby/dsql.git" "url": "git+https://github.com/BenjaminToby/dsql.git"