mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 14:16:01 +00:00
mysql - analyse views, procedures, functions
This commit is contained in:
@@ -3,6 +3,8 @@ const tables = require('./tables');
|
||||
const primaryKeys = require('./primaryKeys');
|
||||
const foreignKeys = require('./foreignKeys');
|
||||
const tableModifications = require('./tableModifications');
|
||||
const views = require('./views');
|
||||
const programmables = require('./programmables');
|
||||
|
||||
module.exports = {
|
||||
columns,
|
||||
@@ -10,4 +12,6 @@ module.exports = {
|
||||
primaryKeys,
|
||||
foreignKeys,
|
||||
tableModifications,
|
||||
views,
|
||||
programmables,
|
||||
};
|
||||
|
||||
8
packages/engines/mysql/sql/programmables.js
Normal file
8
packages/engines/mysql/sql/programmables.js
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = `
|
||||
select
|
||||
ROUTINE_NAME as pureName,
|
||||
ROUTINE_TYPE as objectType,
|
||||
ROUTINE_DEFINITION as createSql
|
||||
from information_schema.routines
|
||||
where ROUTINE_SCHEMA = '#DATABASE#'
|
||||
`;
|
||||
@@ -3,5 +3,5 @@ select
|
||||
TABLE_NAME as pureName,
|
||||
case when ENGINE='InnoDB' then CREATE_TIME else coalesce(UPDATE_TIME, CREATE_TIME) end as alterTime
|
||||
from information_schema.tables
|
||||
where TABLE_SCHEMA = '#DATABASE#' and TABLE_NAME =[OBJECT_NAME_CONDITION];
|
||||
where TABLE_SCHEMA = '#DATABASE#' and TABLE_TYPE='BASE TABLE' and TABLE_NAME =[OBJECT_NAME_CONDITION];
|
||||
`;
|
||||
|
||||
7
packages/engines/mysql/sql/views.js
Normal file
7
packages/engines/mysql/sql/views.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = `
|
||||
select
|
||||
TABLE_NAME as pureName,
|
||||
VIEW_DEFINITION as createSql
|
||||
from information_schema.views
|
||||
where TABLE_SCHEMA = '#DATABASE#' and TABLE_NAME =[OBJECT_NAME_CONDITION];
|
||||
`;
|
||||
Reference in New Issue
Block a user