mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 13:46:00 +00:00
feat: stored procedures and funciton parameters support for mssql
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
module.exports = `
|
||||
SELECT
|
||||
o.object_id as parentObjectId,
|
||||
p.object_id AS parameterObjectId,
|
||||
CASE
|
||||
WHEN p.name IS NULL OR LTRIM(RTRIM(p.name)) = '' THEN
|
||||
'@Output'
|
||||
ELSE
|
||||
p.name
|
||||
END AS pureName,
|
||||
TYPE_NAME(p.user_type_id) AS dataType,
|
||||
p.max_length AS charMaxLength,
|
||||
p.precision AS precision,
|
||||
p.scale AS scale,
|
||||
p.is_output AS isOutputParameter,
|
||||
p.parameter_id AS parameterIndex
|
||||
FROM
|
||||
sys.objects o
|
||||
JOIN
|
||||
sys.parameters p ON o.object_id = p.object_id
|
||||
WHERE
|
||||
o.type IN ('FN', 'IF', 'TF')
|
||||
ORDER BY
|
||||
p.object_id,
|
||||
p.parameter_id;
|
||||
`;
|
||||
@@ -7,6 +7,8 @@ const modifications = require('./modifications');
|
||||
const loadSqlCode = require('./loadSqlCode');
|
||||
const views = require('./views');
|
||||
const programmables = require('./programmables');
|
||||
const proceduresParameters = require('./proceduresParameters');
|
||||
const functionParameters = require('./functionParameters');
|
||||
const viewColumns = require('./viewColumns');
|
||||
const indexes = require('./indexes');
|
||||
const indexcols = require('./indexcols');
|
||||
@@ -20,6 +22,8 @@ module.exports = {
|
||||
loadSqlCode,
|
||||
views,
|
||||
programmables,
|
||||
proceduresParameters,
|
||||
functionParameters,
|
||||
viewColumns,
|
||||
indexes,
|
||||
indexcols,
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
module.exports = `
|
||||
SELECT
|
||||
o.object_id as parentObjectId,
|
||||
p.object_id as objectId,
|
||||
p.name AS pureName,
|
||||
TYPE_NAME(p.user_type_id) AS dataType,
|
||||
p.max_length AS charMaxLength,
|
||||
p.precision AS precision,
|
||||
p.scale AS scale,
|
||||
p.is_output AS isOutputParameter,
|
||||
p.parameter_id AS parameterIndex
|
||||
FROM
|
||||
sys.objects o
|
||||
JOIN
|
||||
sys.parameters p ON o.object_id = p.object_id
|
||||
WHERE
|
||||
o.type = 'P'
|
||||
ORDER BY
|
||||
o.object_id,
|
||||
p.parameter_id;
|
||||
`;
|
||||
Reference in New Issue
Block a user