SYNC: call adapt db info

This commit is contained in:
Jan Prochazka
2025-06-30 08:27:25 +02:00
committed by Diflow
parent 0a29273924
commit ce6d19a77a
5 changed files with 15 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ import type {
ViewInfo,
CollectionInfo,
NamedObjectInfo,
EngineDriver,
} from 'dbgate-types';
import _flatten from 'lodash/flatten';
import _uniq from 'lodash/uniq';
@@ -304,3 +305,11 @@ export function skipDbGateInternalObjects(db: DatabaseInfo) {
tables: (db.tables || []).filter(tbl => tbl.pureName != 'dbgate_deploy_journal'),
};
}
export function adaptDatabaseInfo(db: DatabaseInfo, driver: EngineDriver): DatabaseInfo {
const modelAdapted = {
...db,
tables: db.tables.map(table => driver.adaptTableInfo(table)),
};
return modelAdapted;
}