mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-24 00:16:00 +00:00
Merge branch 'master' of https://github.com/dbgate/dbgate
This commit is contained in:
@@ -149,7 +149,7 @@ module.exports = {
|
||||
byline(subprocess.stdout).on('data', pipeDispatcher('info'));
|
||||
byline(subprocess.stderr).on('data', pipeDispatcher('error'));
|
||||
subprocess.on('exit', code => {
|
||||
this.rejectRequest(runid, { message: 'No data retured, maybe input data source is too big' });
|
||||
this.rejectRequest(runid, { message: 'No data returned, maybe input data source is too big' });
|
||||
logger.info({ code, pid: subprocess.pid }, 'Exited process');
|
||||
socket.emit(`runner-done-${runid}`, code);
|
||||
});
|
||||
|
||||
@@ -166,6 +166,10 @@ const driver = {
|
||||
label: 'New table valued function',
|
||||
sql: 'CREATE FUNCTION myfunc (@arg1 INT) RETURNS TABLE \nAS\nRETURN SELECT * FROM table1',
|
||||
},
|
||||
{
|
||||
label: 'New trigger',
|
||||
sql: 'CREATE TRIGGER trigger_name\nON table_name AFTER INSERT AS\nBEGIN\nSELECT * FROM table_name\nEND',
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
|
||||
@@ -192,6 +192,11 @@ const mysqlDriverBase = {
|
||||
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' },
|
||||
{ label: 'New trigger', sql: 'CREATE FUNCTION myfunc (arg1 INT)\nRETURNS INT DETERMINISTIC\nRETURN 1' },
|
||||
{
|
||||
label: 'New event',
|
||||
sql: 'CREATE EVENT `event_name`\nON SCHEDULE EVERY 1 HOUR\nDO\nBEGIN\n\nEND',
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
@@ -139,6 +139,15 @@ BEGIN
|
||||
END
|
||||
$$ LANGUAGE plpgsql;`,
|
||||
},
|
||||
{
|
||||
label: 'New trigger',
|
||||
sql: `
|
||||
CREATE OR REPLACE TRIGGER trigger_name
|
||||
AFTER INSERT ON "table_name" FOR EACH ROW
|
||||
BEGIN
|
||||
END trigger_name;
|
||||
`,
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ const { driverBase } = global.DBGATE_PACKAGES['dbgate-tools'];
|
||||
const Dumper = require('./Dumper');
|
||||
const { postgreSplitterOptions } = require('dbgate-query-splitter/lib/options');
|
||||
|
||||
const spatialTypes = ['GEOGRAPHY','GEOMETRY'];
|
||||
const spatialTypes = ['GEOGRAPHY', 'GEOMETRY'];
|
||||
|
||||
/** @type {import('dbgate-types').SqlDialect} */
|
||||
const dialect = {
|
||||
@@ -203,6 +203,13 @@ BEGIN
|
||||
END
|
||||
$$ LANGUAGE plpgsql;`,
|
||||
},
|
||||
{
|
||||
label: 'New trigger',
|
||||
sql: `CREATE TRIGGER trigger_name
|
||||
BEFORE INSERT ON table_name
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION function_name();`,
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user