mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 09:36:01 +00:00
storage DB
This commit is contained in:
@@ -134,11 +134,15 @@ export function tableInfoFromYaml(table: TableInfoYaml, allTables: TableInfoYaml
|
||||
return res;
|
||||
}
|
||||
|
||||
export function databaseInfoFromYamlModel(files: DatabaseModelFile[]): DatabaseInfo {
|
||||
export function databaseInfoFromYamlModel(filesOrDbInfo: DatabaseModelFile[] | DatabaseInfo): DatabaseInfo {
|
||||
if (!Array.isArray(filesOrDbInfo)) {
|
||||
return filesOrDbInfo;
|
||||
}
|
||||
|
||||
const model = DatabaseAnalyser.createEmptyStructure();
|
||||
const tablesYaml = [];
|
||||
|
||||
for (const file of files) {
|
||||
for (const file of filesOrDbInfo) {
|
||||
if (file.name.endsWith('.table.yaml') || file.name.endsWith('.sql')) {
|
||||
if (file.name.endsWith('.table.yaml')) {
|
||||
tablesYaml.push(file.json);
|
||||
|
||||
Reference in New Issue
Block a user