mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 04:26:01 +00:00
@@ -71,6 +71,10 @@ class Analyser extends DatabaseAnalyser {
|
||||
this.feedback({ analysingMessage: 'Loading indexes' });
|
||||
const indexes = await this.analyserQuery('indexes', ['tables'], { $owner: this.dbhan.database });
|
||||
this.feedback({ analysingMessage: 'Loading unique names' });
|
||||
|
||||
const triggers = await this.analyserQuery('triggers', undefined, { $owner: this.dbhan.database });
|
||||
this.feedback({ analysingMessage: 'Loading triggers' });
|
||||
|
||||
const uniqueNames = await this.analyserQuery('uniqueNames', ['tables'], { $owner: this.dbhan.database });
|
||||
this.feedback({ analysingMessage: 'Finalizing DB structure' });
|
||||
|
||||
@@ -183,6 +187,15 @@ class Analyser extends DatabaseAnalyser {
|
||||
// schemaName: func.schema_name,
|
||||
contentHash: func.hash_code,
|
||||
})),
|
||||
triggers: triggers.rows.map(row => ({
|
||||
pureName: row.TRIGGER_NAME,
|
||||
trigerName: row.TRIGGER_NAME,
|
||||
definition: row.DEFINITION,
|
||||
tableName: row.TABLE_NAME,
|
||||
triggerLevel: row.TRIGGER_LEVEL,
|
||||
triggerTiming: row.TRIGGER_TIMING,
|
||||
eventType: row.EVENT_TYPE,
|
||||
})),
|
||||
};
|
||||
|
||||
this.feedback({ analysingMessage: null });
|
||||
|
||||
@@ -6,6 +6,7 @@ const views = require('./views');
|
||||
const matviews = require('./matviews');
|
||||
const routines = require('./routines');
|
||||
const indexes = require('./indexes'); // use mysql
|
||||
const triggers = require('./triggers');
|
||||
//const indexcols = require('./indexcols');
|
||||
const uniqueNames = require('./uniqueNames');
|
||||
//const geometryColumns = require('./geometryColumns');
|
||||
@@ -24,7 +25,8 @@ module.exports = {
|
||||
routines,
|
||||
matviews,
|
||||
indexes,
|
||||
// indexcols,
|
||||
triggers,
|
||||
// indexcols,
|
||||
uniqueNames,
|
||||
//geometryColumns,
|
||||
//geographyColumns,
|
||||
|
||||
19
plugins/dbgate-plugin-oracle/src/backend/sql/triggers.js
Normal file
19
plugins/dbgate-plugin-oracle/src/backend/sql/triggers.js
Normal file
@@ -0,0 +1,19 @@
|
||||
module.exports = `
|
||||
SELECT
|
||||
TRIGGER_TYPE AS trigger_timing,
|
||||
TRIGGERING_EVENT AS event_type,
|
||||
TRIGGER_BODY AS definition,
|
||||
TRIGGER_NAME AS trigger_name,
|
||||
TABLE_NAME AS table_name,
|
||||
OWNER,
|
||||
CASE
|
||||
WHEN INSTR(TRIGGER_TYPE, 'ROW') > 0 THEN 'ROW'
|
||||
WHEN INSTR(TRIGGER_TYPE, 'STATEMENT') > 0 THEN 'STATEMENT'
|
||||
ELSE NULL
|
||||
END AS trigger_level
|
||||
FROM
|
||||
all_triggers
|
||||
WHERE
|
||||
OWNER='$owner'
|
||||
AND 'tables:' || TABLE_NAME =OBJECT_ID_CONDITION
|
||||
`;
|
||||
Reference in New Issue
Block a user