Comparing version 45.5.0 to 45.6.0
@@ -109,3 +109,3 @@ "use strict"; | ||
}); | ||
test('produces error if multiple statements are passed as the query input', async (t) => { | ||
test('produces error if multiple statements are passed as the query input (without parameters)', async (t) => { | ||
const pool = await (0, __1.createPool)(t.context.dsn, { | ||
@@ -119,2 +119,15 @@ driverFactory, | ||
}); | ||
// The difference between this test and the previous one is that this one is expected to fail before the query is executed. | ||
// In case of pg driver, that is because of the { queryMode: 'extended' } setting. | ||
test('produces error if multiple statements are passed as the query input (with parameters)', async (t) => { | ||
const pool = await (0, __1.createPool)(t.context.dsn, { | ||
driverFactory, | ||
}); | ||
const error = await t.throwsAsync(pool.query(__1.sql.unsafe ` | ||
SELECT ${1}; SELECT ${2}; | ||
`)); | ||
// The actual error is going to be driver specific, e.g.: 'cannot insert multiple commands into a prepared statement'. | ||
// However, Slonik will require compatible drivers to throw InputSyntaxError. | ||
t.true(error instanceof __1.InputSyntaxError); | ||
}); | ||
test('NotNullIntegrityConstraintViolationError identifies the table and column', async (t) => { | ||
@@ -121,0 +134,0 @@ const pool = await (0, __1.createPool)(t.context.dsn, { |
@@ -8,7 +8,7 @@ { | ||
"dependencies": { | ||
"@slonik/driver": "^45.5.0", | ||
"@slonik/errors": "^45.5.0", | ||
"@slonik/pg-driver": "^45.5.0", | ||
"@slonik/sql-tag": "^45.5.0", | ||
"@slonik/utilities": "^45.5.0", | ||
"@slonik/driver": "^45.6.0", | ||
"@slonik/errors": "^45.6.0", | ||
"@slonik/pg-driver": "^45.6.0", | ||
"@slonik/sql-tag": "^45.6.0", | ||
"@slonik/utilities": "^45.6.0", | ||
"get-stack-trace": "^3.1.1", | ||
@@ -87,3 +87,3 @@ "iso8601-duration": "^1.3.0", | ||
"types": "./dist/index.d.ts", | ||
"version": "45.5.0" | ||
"version": "45.6.0" | ||
} |
@@ -142,3 +142,3 @@ /* eslint-disable id-length */ | ||
test('produces error if multiple statements are passed as the query input', async (t) => { | ||
test('produces error if multiple statements are passed as the query input (without parameters)', async (t) => { | ||
const pool = await createPool(t.context.dsn, { | ||
@@ -157,2 +157,20 @@ driverFactory, | ||
// The difference between this test and the previous one is that this one is expected to fail before the query is executed. | ||
// In case of pg driver, that is because of the { queryMode: 'extended' } setting. | ||
test('produces error if multiple statements are passed as the query input (with parameters)', async (t) => { | ||
const pool = await createPool(t.context.dsn, { | ||
driverFactory, | ||
}); | ||
const error = await t.throwsAsync( | ||
pool.query(sql.unsafe` | ||
SELECT ${1}; SELECT ${2}; | ||
`), | ||
); | ||
// The actual error is going to be driver specific, e.g.: 'cannot insert multiple commands into a prepared statement'. | ||
// However, Slonik will require compatible drivers to throw InputSyntaxError. | ||
t.true(error instanceof InputSyntaxError); | ||
}); | ||
test('NotNullIntegrityConstraintViolationError identifies the table and column', async (t) => { | ||
@@ -159,0 +177,0 @@ const pool = await createPool(t.context.dsn, { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
645278
12852
Updated@slonik/driver@^45.6.0
Updated@slonik/errors@^45.6.0
Updated@slonik/pg-driver@^45.6.0
Updated@slonik/sql-tag@^45.6.0
Updated@slonik/utilities@^45.6.0