Socket
Socket
Sign inDemoInstall

slonik

Package Overview
Dependencies
Maintainers
1
Versions
395
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slonik - npm Package Compare versions

Comparing version 45.5.0 to 45.6.0

15

dist/helpers.test/createIntegrationTests.js

@@ -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, {

12

package.json

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc