sqlite incremental model update

This commit is contained in:
Jan Prochazka
2021-05-23 19:57:24 +02:00
parent 44b8a14868
commit dacea78123

View File

@@ -6,6 +6,27 @@ class Analyser extends DatabaseAnalyser {
super(pool, driver);
}
async _getFastSnapshot() {
const objects = await this.driver.query(this.pool, "select * from sqlite_master where type='table' or type='view'");
return {
tables: objects.rows
.filter((x) => x.type == 'table')
.map((x) => ({
pureName: x.name,
objectId: x.name,
contentHash: x.sql,
})),
views: objects.rows
.filter((x) => x.type == 'view')
.map((x) => ({
pureName: x.name,
objectId: x.name,
contentHash: x.sql,
})),
};
}
async _runAnalysis() {
const objects = await this.driver.query(this.pool, "select * from sqlite_master where type='table' or type='view'");
const tables = objects.rows.filter((x) => x.type == 'table');