This commit is contained in:
2026-07-14 08:12:13 +01:00
parent b5e4724e03
commit 3b5fba4063
26 changed files with 1097 additions and 321 deletions
+1 -23
View File
@@ -6,31 +6,9 @@ import typedef from "./typedef";
import backup from "./backup";
import restore from "./restore";
import admin from "./admin";
import type {
BUN_MARIADB_DatabaseSchemaType,
BunMariaDBConfig,
} from "../types";
import init from "../functions/init";
/**
* # Declare Global Variables
*/
declare global {
var CONFIG: BunMariaDBConfig;
var DB_SCHEMA: BUN_MARIADB_DatabaseSchemaType;
}
await init();
if (!global.CONFIG) {
console.error(`Couldn't grab global Config.`);
process.exit(1);
}
if (!global.DB_SCHEMA) {
console.error(`Couldn't grab Database Schema.`);
process.exit(1);
}
init();
/**
* # Describe Program
+8 -5
View File
@@ -7,6 +7,7 @@ import _ from "lodash";
import appendDefaultFieldsToDbSchema from "../utils/append-default-fields-to-db-schema";
import chalk from "chalk";
import { writeLiveSchema } from "../functions/live-schema";
import createDBSchema from "../lib/schema/create-db-schema";
export default function () {
return new Command("schema")
@@ -31,12 +32,14 @@ export default function () {
dbSchema,
});
const manager = new MariaDBSchemaManager({
schema: finaldbSchema,
});
// const manager = new MariaDBSchemaManager({
// schema: finaldbSchema,
// });
await manager.syncSchema();
manager.close();
// await manager.syncSchema();
// manager.close();
await createDBSchema({ db_schema: finaldbSchema });
if (isTypeDef && config.typedef_file_path) {
const out_file = path.resolve(