sqlite table analyser

This commit is contained in:
Jan Prochazka
2021-05-05 20:04:49 +02:00
parent 28e19402f3
commit e739aed80d
5 changed files with 57 additions and 16 deletions

View File

@@ -66,14 +66,7 @@ class Analyser extends DatabaseAnalyser {
}
getRequestedViewNames(allViewNames) {
if (this.singleObjectFilter) {
const { typeField, pureName } = this.singleObjectFilter;
if (typeField == 'views') return [pureName];
}
if (this.modifications) {
return this.modifications.filter(x => x.objectTypeField == 'views').map(x => x.newName.pureName);
}
return allViewNames;
return this.getRequestedObjectPureNames('views', allViewNames);
}
async getViewTexts(allViewNames) {
@@ -82,7 +75,7 @@ class Analyser extends DatabaseAnalyser {
try {
const resp = await this.driver.query(this.pool, `SHOW CREATE VIEW \`${viewName}\``);
res[viewName] = resp.rows[0]['Create View'];
} catch(err) {
} catch (err) {
console.log('ERROR', err);
res[viewName] = `${err}`;
}