fixed SQLite

This commit is contained in:
SPRINX0\prochazka
2024-09-20 10:47:51 +02:00
parent 780d187911
commit f34d0cbb90
2 changed files with 9 additions and 9 deletions

View File

@@ -16,8 +16,8 @@ SELECT
`;
class Analyser extends DatabaseAnalyser {
constructor(pool, driver, version) {
super(pool, driver, version);
constructor(dbhan, driver, version) {
super(dbhan, driver, version);
}
async _computeSingleObjectId() {
@@ -26,8 +26,8 @@ class Analyser extends DatabaseAnalyser {
}
async _getFastSnapshot() {
const objects = await this.driver.query(this.pool, "select * from sqlite_master where type='table' or type='view'");
const indexcols = await this.driver.query(this.pool, indexcolsQuery);
const objects = await this.driver.query(this.dbhan, "select * from sqlite_master where type='table' or type='view'");
const indexcols = await this.driver.query(this.dbhan, indexcolsQuery);
return {
tables: objects.rows
@@ -79,7 +79,7 @@ class Analyser extends DatabaseAnalyser {
createSql: x.sql,
}));
const indexcols = await this.driver.query(this.pool, indexcolsQuery);
const indexcols = await this.driver.query(this.dbhan, indexcolsQuery);
for (const tableName of this.getRequestedObjectPureNames(
'tables',
@@ -88,7 +88,7 @@ class Analyser extends DatabaseAnalyser {
const tableObj = tableList.find((x) => x.pureName == tableName);
if (!tableObj) continue;
const info = await this.driver.query(this.pool, `pragma table_info('${tableName}')`);
const info = await this.driver.query(this.dbhan, `pragma table_info('${tableName}')`);
tableObj.columns = info.rows.map((col) => ({
columnName: col.name,
dataType: col.type,
@@ -132,7 +132,7 @@ class Analyser extends DatabaseAnalyser {
};
}
const fklist = await this.driver.query(this.pool, `pragma foreign_key_list('${tableName}')`);
const fklist = await this.driver.query(this.dbhan, `pragma foreign_key_list('${tableName}')`);
tableObj.foreignKeys = _.values(_.groupBy(fklist.rows, 'id')).map((fkcols) => {
const fkcol = fkcols[0];
const fk = {
@@ -157,7 +157,7 @@ class Analyser extends DatabaseAnalyser {
const viewObj = viewList.find((x) => x.pureName == viewName);
if (!viewObj) continue;
const info = await this.driver.query(this.pool, `pragma table_info('${viewName}')`);
const info = await this.driver.query(this.dbhan, `pragma table_info('${viewName}')`);
viewObj.columns = info.rows.map((col) => ({
columnName: col.name,
dataType: col.type,