From 0c1c8788b8619862ab9b761d8a58e4ea392df41a Mon Sep 17 00:00:00 2001 From: "me@rodrigorodriguez.com" Date: Thu, 17 Oct 2024 14:00:42 -0300 Subject: [PATCH] new(core.gbapp): LLM alerts for data. --- packages/basic.gblib/services/GBVMService.ts | 6 ++++++ packages/basic.gblib/services/SystemKeywords.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/basic.gblib/services/GBVMService.ts b/packages/basic.gblib/services/GBVMService.ts index 5e71eaf4..c0d2f2ef 100644 --- a/packages/basic.gblib/services/GBVMService.ts +++ b/packages/basic.gblib/services/GBVMService.ts @@ -415,6 +415,12 @@ export class GBVMService extends GBService { }); sync = sync ? sync : !found; + + // Do not erase tables in case of an error in collection retrieval. + + if (tables.length === 0){ + sync = false; + } associations.forEach(e => { const from = seq.models[e.from]; diff --git a/packages/basic.gblib/services/SystemKeywords.ts b/packages/basic.gblib/services/SystemKeywords.ts index 87d6e4fd..0494f1a6 100644 --- a/packages/basic.gblib/services/SystemKeywords.ts +++ b/packages/basic.gblib/services/SystemKeywords.ts @@ -2912,7 +2912,7 @@ export class SystemKeywords { const dialect = con.dialect.name; // Step 3: Get the list of all tables from the source database - const tables = await GBUtil.listTables(dialect, min.core.sequelize); + const tables = await GBUtil.listTables(dialect, con); // Function to map source database datatypes to SQLite-compatible datatypes const mapToSQLiteType = (columnType) => {