dbgate-query-splitter
Advanced tools
Comparing version 4.9.2 to 4.9.3
@@ -157,3 +157,3 @@ "use strict"; | ||
if (context.options.adaptiveGoSplit) { | ||
const m = s.slice(pos).match(/^CREATE\s*(PROCEDURE|FUNCTION|TRIGGER)/i); | ||
const m = s.slice(pos).match(/^(CREATE|ALTER)\s*(PROCEDURE|FUNCTION|TRIGGER)/i); | ||
if (m) { | ||
@@ -160,0 +160,0 @@ return { |
@@ -49,4 +49,10 @@ "use strict"; | ||
test('adaptive go split -mssql', () => { | ||
const output = (0, splitQuery_1.splitQuery)('SELECT 1;CREATE PROCEDURE p1 AS BEGIN SELECT 2;SELECT 3;END\nGO\nSELECT 4;SELECT 5', Object.assign(Object.assign({}, options_1.mssqlSplitterOptions), { adaptiveGoSplit: true })); | ||
expect(output).toEqual(['SELECT 1', 'CREATE PROCEDURE p1 AS BEGIN SELECT 2;SELECT 3;END', 'SELECT 4', 'SELECT 5']); | ||
const output = (0, splitQuery_1.splitQuery)('SELECT 1;CREATE PROCEDURE p1 AS BEGIN SELECT 2;SELECT 3;END\nGO\nSELECT 4;SELECT 5;ALTER PROCEDURE p1 AS BEGIN SELECT 2;SELECT 3;END', Object.assign(Object.assign({}, options_1.mssqlSplitterOptions), { adaptiveGoSplit: true })); | ||
expect(output).toEqual([ | ||
'SELECT 1', | ||
'CREATE PROCEDURE p1 AS BEGIN SELECT 2;SELECT 3;END', | ||
'SELECT 4', | ||
'SELECT 5', | ||
'ALTER PROCEDURE p1 AS BEGIN SELECT 2;SELECT 3;END', | ||
]); | ||
}); | ||
@@ -53,0 +59,0 @@ test('delimiter test', () => { |
{ | ||
"version": "4.9.2", | ||
"version": "4.9.3", | ||
"name": "dbgate-query-splitter", | ||
@@ -4,0 +4,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39995
847