oracle analyser code cleanup

This commit is contained in:
Jan Prochazka 2024-05-31 16:06:39 +02:00
parent df60d40134
commit 8f5b395935
14 changed files with 3 additions and 48 deletions

View File

@ -88,17 +88,12 @@ class Analyser extends DatabaseAnalyser {
const matviews = this.driver.dialect.materializedViews
? await this.analyserQuery('matviews', ['matviews'], { $owner: this.pool._schema_name })
: null;
this.feedback({ analysingMessage: 'Loading materialized view columns' });
const matviewColumns = this.driver.dialect.materializedViews
? await this.analyserQuery('matviewColumns', ['matviews'], { $owner: this.pool._schema_name })
: null;
this.feedback({ analysingMessage: 'Loading routines' });
const routines = await this.analyserQuery('routines', ['procedures', 'functions'], {
$owner: this.pool._schema_name,
});
this.feedback({ analysingMessage: 'Loading indexes' });
const indexes = await this.analyserQuery('indexes', ['tables'], { $owner: this.pool._schema_name });
this.feedback({ analysingMessage: 'Loading index columns' });
this.feedback({ analysingMessage: 'Loading unique names' });
const uniqueNames = await this.analyserQuery('uniqueNames', ['tables'], { $owner: this.pool._schema_name });
this.feedback({ analysingMessage: 'Finalizing DB structure' });
@ -187,9 +182,7 @@ class Analyser extends DatabaseAnalyser {
schemaName: matview.schema_name,
contentHash: matview.hash_code,
createSql: `CREATE MATERIALIZED VIEW "${matview.schema_name}"."${matview.pure_name}"\nAS\n${matview.definition}`,
columns: matviewColumns.rows
.filter(col => col.pure_name == matview.pure_name && col.schema_name == matview.schema_name)
.map(col => getColumnInfo(col)),
columns: (columnsGrouped[columnGroup(view)] || []).map(col => getColumnInfo(col)),
}))
: undefined,
procedures: routines.rows

View File

@ -1,2 +0,0 @@
module.exports = `
`;

View File

@ -1,2 +0,0 @@
module.exports = `
`;

View File

@ -1,2 +0,0 @@
module.exports = `
`;

View File

@ -1,2 +0,0 @@
module.exports = `
`;

View File

@ -1,2 +0,0 @@
module.exports = `
`;

View File

@ -1,15 +1,10 @@
const columns = require('./columns');
const tableModifications = require('./tableList');
const tableList = require('./tableList');
const viewModifications = require('./views');
const matviewModifications = require('./matviews');
const primaryKeys = require('./primaryKeys');
const foreignKeys = require('./foreignKeys');
const views = require('./views');
const matviews = require('./matviews');
const routines = require('./routines');
const routineModifications = require('./routines');
const matviewColumns = require('./matviewColumns');
const indexes = require('./indexes'); // use mysql
//const indexcols = require('./indexcols');
const uniqueNames = require('./uniqueNames');
@ -22,17 +17,12 @@ const uniqueNames = require('./uniqueNames');
module.exports = {
columns,
tableModifications,
tableList,
viewModifications,
primaryKeys,
foreignKeys,
views,
routines,
routineModifications,
matviews,
matviewModifications,
matviewColumns,
indexes,
// indexcols,
uniqueNames,

View File

@ -1,2 +0,0 @@
module.exports = `
`;

View File

@ -1,9 +0,0 @@
module.exports = `
SELECT -- owner "schema_name"
table_name "pure_name"
, column_name "column_name"
, data_type "data_type"
FROM all_tab_columns av
where OWNER = '$owner' AND table_name =OBJECT_ID_CONDITION
order by column_id
`;

View File

@ -1,2 +0,0 @@
module.exports = `
`;

View File

@ -2,7 +2,7 @@ module.exports = `
select
-- pk.owner as "constraint_schema",
pk.constraint_name as "constraint_name",
pk.owner as "schema_name",
-- pk.owner as "schema_name",
pk.table_name as "pure_name",
basecol.column_name as "column_name"
from all_cons_columns basecol,
@ -12,5 +12,6 @@ and basecol.owner = pk.owner
and basecol.constraint_name = pk.constraint_name
and basecol.table_name = pk.table_name
and pk.constraint_name =OBJECT_ID_CONDITION
and pk.owner = '$owner'
order by basecol.position
`;

View File

@ -1,2 +0,0 @@
module.exports = `
`;

View File

@ -1,2 +0,0 @@
module.exports = `
`;

View File

@ -1,2 +0,0 @@
module.exports = `
`;