mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
fix
This commit is contained in:
parent
3a08462018
commit
2376cb30db
@ -33,8 +33,8 @@ export class DatabaseAnalyser {
|
||||
this.singleObjectFilter = { ...name, typeField };
|
||||
await this._computeSingleObjectId();
|
||||
const res = this._runAnalysis();
|
||||
if (res[typeField].length == 1) return res[typeField][0];
|
||||
const obj = res[typeField].find(x => x.pureName == name.pureName && x.schemaName == name.schemaName);
|
||||
if (res[typeField]?.length == 1) return res[typeField][0];
|
||||
const obj = res[typeField]?.find(x => x.pureName == name.pureName && x.schemaName == name.schemaName);
|
||||
return obj;
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ export class DatabaseAnalyser {
|
||||
const { typeField } = this.singleObjectFilter;
|
||||
if (!this.singleObjectId) return null;
|
||||
if (!typeFields || !typeFields.includes(typeField)) return null;
|
||||
return template.replace(/=OBJECT_ID_CONDITION/g, ` = ${this.singleObjectId}`);
|
||||
return template.replace(/=OBJECT_ID_CONDITION/g, ` = '${this.singleObjectId}'`);
|
||||
}
|
||||
if (!this.modifications || !typeFields || this.modifications.length == 0) {
|
||||
return template.replace(/=OBJECT_ID_CONDITION/g, ' is not null');
|
||||
|
@ -57,7 +57,6 @@ class Analyser extends DatabaseAnalyser {
|
||||
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 {
|
||||
tables: tables.rows.map(table => {
|
||||
|
Loading…
Reference in New Issue
Block a user