mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 13:46:00 +00:00
@@ -14,6 +14,7 @@ function getColumnInfo({
|
||||
numericPrecision,
|
||||
numericScale,
|
||||
defaultValue,
|
||||
columnComment,
|
||||
}) {
|
||||
let fullDataType = dataType;
|
||||
if (charMaxLength && isTypeString(dataType)) fullDataType = `${dataType}(${charMaxLength})`;
|
||||
@@ -23,6 +24,7 @@ function getColumnInfo({
|
||||
notNull: !isNullable || isNullable == 'NO' || isNullable == 'no',
|
||||
autoIncrement: !!(extra && extra.toLowerCase().includes('auto_increment')),
|
||||
columnName,
|
||||
columnComment,
|
||||
dataType: fullDataType,
|
||||
defaultValue,
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@ select
|
||||
NUMERIC_PRECISION as numericPrecision,
|
||||
NUMERIC_SCALE as numericScale,
|
||||
COLUMN_DEFAULT as defaultValue,
|
||||
COLUMN_COMMENT as columnComment,
|
||||
EXTRA as extra
|
||||
from INFORMATION_SCHEMA.COLUMNS
|
||||
where TABLE_SCHEMA = '#DATABASE#' and TABLE_NAME =OBJECT_ID_CONDITION
|
||||
|
||||
@@ -30,6 +30,10 @@ const dialect = {
|
||||
dropCheck: true,
|
||||
|
||||
dropReferencesWhenDropTable: false,
|
||||
|
||||
columnProperties: {
|
||||
columnComment: true,
|
||||
},
|
||||
};
|
||||
|
||||
const mysqlDriverBase = {
|
||||
@@ -44,7 +48,11 @@ const mysqlDriverBase = {
|
||||
getNewObjectTemplates() {
|
||||
return [
|
||||
{ label: 'New view', sql: 'CREATE VIEW myview\nAS\nSELECT * FROM table1' },
|
||||
{ label: 'New procedure', sql: 'DELIMITER //\n\nCREATE PROCEDURE myproc (IN arg1 INT)\nBEGIN\n SELECT * FROM table1;\nEND\n\nDELIMITER ;' },
|
||||
{
|
||||
label: 'New procedure',
|
||||
sql:
|
||||
'DELIMITER //\n\nCREATE PROCEDURE myproc (IN arg1 INT)\nBEGIN\n SELECT * FROM table1;\nEND\n\nDELIMITER ;',
|
||||
},
|
||||
{ label: 'New function', sql: 'CREATE FUNCTION myfunc (arg1 INT)\nRETURNS INT DETERMINISTIC\nRETURN 1' },
|
||||
];
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user