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.2 to 1.0.3

13

dist/client.d.ts

@@ -19,8 +19,13 @@ /// <reference types="node" />

export interface PGTransactionable extends PGQueryable {
/** Start a transaction by issuing a `BEGIN` statement */
begin(): Promise<this>;
/**
* Start a transaction by issuing a `BEGIN` statement
*
* @returns `true` if a transaction was created, or `false` if `begin()` was
* already called and a transaction was already started.
*/
begin(): Promise<boolean>;
/** Commit a transaction by issuing a `COMMIT` statement */
commit(): Promise<this>;
commit(): Promise<void>;
/** Cancel a transaction by issuing a `ROLLBACK` statement */
rollback(): Promise<this>;
rollback(): Promise<void>;
}

@@ -27,0 +32,0 @@ /** A consumer for a {@link PGTransactionable} connection */

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

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

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

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

@@ -41,8 +41,13 @@ import { Registry, serialize } from '@juit/pgproxy-types'

export interface PGTransactionable extends PGQueryable {
/** Start a transaction by issuing a `BEGIN` statement */
begin(): Promise<this>
/**
* Start a transaction by issuing a `BEGIN` statement
*
* @returns `true` if a transaction was created, or `false` if `begin()` was
* already called and a transaction was already started.
*/
begin(): Promise<boolean>
/** Commit a transaction by issuing a `COMMIT` statement */
commit(): Promise<this>
commit(): Promise<void>
/** Cancel a transaction by issuing a `ROLLBACK` statement */
rollback(): Promise<this>
rollback(): Promise<void>
}

@@ -151,16 +156,14 @@

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

@@ -167,0 +170,0 @@ }

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