postgre analyser

This commit is contained in:
Jan Prochazka
2020-06-29 20:21:37 +02:00
parent 3c1be39976
commit 71861779e8
3 changed files with 15 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ class PostgreAnalyser extends DatabaseAnalayser {
const pkColumns = await this.driver.query(this.pool, this.createQuery('primaryKeys', ['tables']));
const fkColumns = await this.driver.query(this.pool, this.createQuery('foreignKeys', ['tables']));
const views = await this.driver.query(this.pool, this.createQuery('views', ['views']));
const routines = await this.driver.query(this.pool, this.createQuery('routines', ['procedures', 'functions']));
// console.log('PG fkColumns', fkColumns.rows);
return this.mergeAnalyseResult({
@@ -68,6 +69,8 @@ class PostgreAnalyser extends DatabaseAnalayser {
.filter((col) => col.pureName == view.pureName && col.schemaName == view.schemaName)
.map(getColumnInfo),
})),
procedures: routines.rows.filter((x) => x.objectType == 'PROCEDURE'),
functions: routines.rows.filter((x) => x.objectType == 'FUNCTION'),
});
}
}