Socket
Socket
Sign inDemoInstall

@juit/pgproxy-client

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@juit/pgproxy-client - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

dist/provider.d.ts

@@ -14,3 +14,3 @@ /// <reference types="node" />

export interface PGConnection {
query(text: string, params: (string | null)[]): Promise<PGConnectionResult>;
query(text: string, params?: (string | null)[]): Promise<PGConnectionResult>;
}

@@ -28,3 +28,3 @@ export interface PGProviderConstructor<Connection extends PGConnection> {

abstract release(connection: PGConnection): Promise<void>;
query(text: string, params: string[]): Promise<PGConnectionResult>;
query(text: string, params?: (string | null)[]): Promise<PGConnectionResult>;
destroy(): Promise<void>;

@@ -31,0 +31,0 @@ }

@@ -33,3 +33,3 @@ import type { PGConnection, PGConnectionResult, PGProvider } from './provider';

private readonly _connections;
abstract query(text: string, params: (string | null)[]): Promise<PGConnectionResult>;
abstract query(text: string, params?: (string | null)[]): Promise<PGConnectionResult>;
/** Return a unique request identifier to correlate responses */

@@ -36,0 +36,0 @@ protected abstract _getUniqueRequestId(): string;

{
"name": "@juit/pgproxy-client",
"version": "1.0.1",
"version": "1.0.2",
"main": "./dist/index.cjs",

@@ -38,3 +38,3 @@ "module": "./dist/index.mjs",

"dependencies": {
"@juit/pgproxy-types": "1.0.1"
"@juit/pgproxy-types": "1.0.2"
},

@@ -41,0 +41,0 @@ "directories": {

@@ -137,2 +137,3 @@ import { Registry, serialize } from '@juit/pgproxy-types'

const connection = await this._provider.acquire()
let transaction = false

@@ -151,11 +152,14 @@ try {

async begin(): Promise<PGTransactionable> {
await this.query('BEGIN')
await connection.query('BEGIN')
transaction = true
return this
},
async commit(): Promise<PGTransactionable> {
await this.query('COMMIT')
await connection.query('COMMIT')
transaction = false
return this
},
async rollback(): Promise<PGTransactionable> {
await this.query('ROLLBACK')
await connection.query('ROLLBACK')
transaction = false
return this

@@ -167,2 +171,3 @@ },

} finally {
if (transaction) await connection.query('ROLLBACK')
await this._provider.release(connection)

@@ -169,0 +174,0 @@ }

@@ -21,3 +21,3 @@ import { assert } from './assert'

export interface PGConnection {
query(text: string, params: (string | null)[]): Promise<PGConnectionResult>
query(text: string, params?: (string | null)[]): Promise<PGConnectionResult>
}

@@ -44,3 +44,3 @@

async query(text: string, params: string[]): Promise<PGConnectionResult> {
async query(text: string, params: (string | null)[] = []): Promise<PGConnectionResult> {
const connection = await this.acquire()

@@ -47,0 +47,0 @@ try {

@@ -151,3 +151,3 @@ import { assert } from './assert'

query(query: string, params: (string | null)[]): Promise<PGConnectionResult> {
query(query: string, params: (string | null)[] = []): Promise<PGConnectionResult> {
/* The error is set also when the websocket is closed, soooooo... */

@@ -190,3 +190,3 @@ if (this._error) return Promise.reject(this._error)

abstract query(text: string, params: (string | null)[]): Promise<PGConnectionResult>
abstract query(text: string, params?: (string | null)[]): Promise<PGConnectionResult>

@@ -193,0 +193,0 @@ /** Return a unique request identifier to correlate responses */

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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