mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 15:13:57 +00:00
fixes single object analyser
This commit is contained in:
@@ -30,11 +30,16 @@ export class DatabaseAnalyser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async singleObjectAnalysis(name, typeField) {
|
async singleObjectAnalysis(name, typeField) {
|
||||||
|
// console.log('Analysing SINGLE OBJECT', name, typeField);
|
||||||
this.singleObjectFilter = { ...name, typeField };
|
this.singleObjectFilter = { ...name, typeField };
|
||||||
await this._computeSingleObjectId();
|
await this._computeSingleObjectId();
|
||||||
const res = this._runAnalysis();
|
const res = await this._runAnalysis();
|
||||||
if (res[typeField]?.length == 1) return res[typeField][0];
|
// console.log('SINGLE OBJECT RES', res);
|
||||||
const obj = res[typeField]?.find(x => x.pureName == name.pureName && x.schemaName == name.schemaName);
|
const obj =
|
||||||
|
res[typeField]?.length == 1
|
||||||
|
? res[typeField][0]
|
||||||
|
: res[typeField]?.find(x => x.pureName == name.pureName && x.schemaName == name.schemaName);
|
||||||
|
// console.log('SINGLE OBJECT', obj);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
return this.getRequestedObjectPureNames('views', allViewNames);
|
return this.getRequestedObjectPureNames('views', allViewNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _computeSingleObjectId() {
|
||||||
|
const { pureName } = this.singleObjectFilter;
|
||||||
|
this.singleObjectId = pureName;
|
||||||
|
}
|
||||||
|
|
||||||
async getViewTexts(allViewNames) {
|
async getViewTexts(allViewNames) {
|
||||||
const res = {};
|
const res = {};
|
||||||
for (const viewName of this.getRequestedViewNames(allViewNames)) {
|
for (const viewName of this.getRequestedViewNames(allViewNames)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user