mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 13:23:58 +00:00
Merge pull request #101 from knixeur/fix/allow_structure_on_view_error
fix: catch getViewTexts errors otherwise no structure can be seen
This commit is contained in:
@@ -79,8 +79,13 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
async getViewTexts(allViewNames) {
|
async getViewTexts(allViewNames) {
|
||||||
const res = {};
|
const res = {};
|
||||||
for (const viewName of this.getRequestedViewNames(allViewNames)) {
|
for (const viewName of this.getRequestedViewNames(allViewNames)) {
|
||||||
|
try {
|
||||||
const resp = await this.driver.query(this.pool, `SHOW CREATE VIEW \`${viewName}\``);
|
const resp = await this.driver.query(this.pool, `SHOW CREATE VIEW \`${viewName}\``);
|
||||||
res[viewName] = resp.rows[0]['Create View'];
|
res[viewName] = resp.rows[0]['Create View'];
|
||||||
|
} catch(err) {
|
||||||
|
console.log('ERROR', err);
|
||||||
|
res[viewName] = `${err}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user