SYNC: Merge pull request #7 from dbgate/feature/applog

This commit is contained in:
Jan Prochazka
2025-08-05 17:13:33 +02:00
committed by Diflow
parent ac0aebd751
commit a96f1d0b49
83 changed files with 1014 additions and 242 deletions

View File

@@ -45,26 +45,26 @@ class Analyser extends DatabaseAnalyser {
}
async _runAnalysis() {
this.feedback({ analysingMessage: 'Loading tables' });
this.feedback({ analysingMessage: 'DBGM-00230 Loading tables' });
const tables = await this.analyserQuery('tableList', ['tables'], { $owner: this.dbhan.database });
this.feedback({ analysingMessage: 'Loading columns' });
this.feedback({ analysingMessage: 'DBGM-00231 Loading columns' });
const columns = await this.analyserQuery('columns', ['tables', 'views'], { $owner: this.dbhan.database });
this.feedback({ analysingMessage: 'Loading primary keys' });
this.feedback({ analysingMessage: 'DBGM-00232 Loading primary keys' });
const pkColumns = await this.analyserQuery('primaryKeys', ['tables'], { $owner: this.dbhan.database });
//let fkColumns = null;
this.feedback({ analysingMessage: 'Loading foreign keys' });
this.feedback({ analysingMessage: 'DBGM-00233 Loading foreign keys' });
const fkColumns = await this.analyserQuery('foreignKeys', ['tables'], { $owner: this.dbhan.database });
this.feedback({ analysingMessage: 'Loading views' });
this.feedback({ analysingMessage: 'DBGM-00234 Loading views' });
const views = await this.analyserQuery('views', ['views'], { $owner: this.dbhan.database });
this.feedback({ analysingMessage: 'Loading materialized views' });
this.feedback({ analysingMessage: 'DBGM-00235 Loading materialized views' });
const matviews = this.driver.dialect.materializedViews
? await this.analyserQuery('matviews', ['matviews'], { $owner: this.dbhan.database })
: null;
this.feedback({ analysingMessage: 'Loading routines' });
this.feedback({ analysingMessage: 'DBGM-00236 Loading routines' });
const routines = await this.analyserQuery('routines', ['procedures', 'functions'], {
$owner: this.dbhan.database,
});
@@ -91,15 +91,15 @@ class Analyser extends DatabaseAnalyser {
return acc;
}, {});
this.feedback({ analysingMessage: 'Loading indexes' });
this.feedback({ analysingMessage: 'DBGM-00237 Loading indexes' });
const indexes = await this.analyserQuery('indexes', ['tables'], { $owner: this.dbhan.database });
this.feedback({ analysingMessage: 'Loading unique names' });
this.feedback({ analysingMessage: 'DBGM-00238 Loading unique names' });
const triggers = await this.analyserQuery('triggers', undefined, { $owner: this.dbhan.database });
this.feedback({ analysingMessage: 'Loading triggers' });
this.feedback({ analysingMessage: 'DBGM-00239 Loading triggers' });
const uniqueNames = await this.analyserQuery('uniqueNames', ['tables'], { $owner: this.dbhan.database });
this.feedback({ analysingMessage: 'Finalizing DB structure' });
this.feedback({ analysingMessage: 'DBGM-00240 Finalizing DB structure' });
const fkColumnsMapped = fkColumns.rows.map(x => ({
pureName: x.pure_name,