mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 19:26:00 +00:00
backend bundle refactor
This commit is contained in:
15
packages/engines/mysql/sql/columns.js
Normal file
15
packages/engines/mysql/sql/columns.js
Normal file
@@ -0,0 +1,15 @@
|
||||
module.exports = `
|
||||
select
|
||||
TABLE_NAME as pureName,
|
||||
COLUMN_NAME as columnName,
|
||||
IS_NULLABLE as isNullable,
|
||||
DATA_TYPE as dataType,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
NUMERIC_PRECISION,
|
||||
NUMERIC_SCALE,
|
||||
COLUMN_DEFAULT,
|
||||
EXTRA as extra
|
||||
from INFORMATION_SCHEMA.COLUMNS
|
||||
where TABLE_SCHEMA = '#DATABASE#' and TABLE_NAME =[OBJECT_NAME_CONDITION]
|
||||
order by ORDINAL_POSITION
|
||||
`;
|
||||
7
packages/engines/mysql/sql/index.js
Normal file
7
packages/engines/mysql/sql/index.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const columns = require('./columns');
|
||||
const tables = require('./tables');
|
||||
|
||||
module.exports = {
|
||||
columns,
|
||||
tables,
|
||||
};
|
||||
7
packages/engines/mysql/sql/tables.js
Normal file
7
packages/engines/mysql/sql/tables.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = `
|
||||
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];
|
||||
`;
|
||||
Reference in New Issue
Block a user