Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wyseman

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wyseman - npm Package Compare versions

Comparing version 1.0.21 to 1.0.22

bin/wyseman.js

34

lib/dbclient.js

@@ -143,9 +143,9 @@ //Low level connection to PostgreSQL database

// -------------------------------------------------------------------
query(...args) { // Attempt a DB query. If not yet connected, queue the request and attempt to connect
query(...args) { // Attempt a DB query with callback.
this.log.trace("Query:", this.config.user, args[0].substr(0,256), args[1])
if (this.client && this.client._connected) { //If connection ready, run the query
this.client.query(...args)
} else { // else save the command for later
return this.client.query(...args)
} else { // else queue the command for later
this.queryQue.push(args)
this.log.trace(" queueing it: ", this.queryQue.length)
this.log.trace(" queueing query: ", this.queryQue.length)
if (!this.connecting) this.connect(() => { //Get this client connected

@@ -155,10 +155,28 @@ let q; while (q = this.queryQue.shift()) this.query(...q) //And process the queue

}
} //query()
}
// -------------------------------------------------------------------
t(...args) { // Wrap a query in a transaction
t(...args) { // Wrap a callback query in a transaction
args[0] = 'begin; ' + args[0] + '; commit;'
this.query(...args)
} //t()
}
} //class dbClient
// -------------------------------------------------------------------
async pquery(...args) { // Query DB returning promise/rows
this.log.trace("Exec:", this.config.user, args[0].substr(0,256), args[1])
if (!this.client) {
await new Promise(resolve => this.connect(resolve))
} else if (this.client._connected) {
} else {
while (this.connecting) {
await new Promise(resolve => setTimeout(resolve, 250))
}
}
let result = await this.client.query(...args)
//this.log.trace('F:', Object.keys(result), JSON.stringify(result))
return result.rows
}
} //class
//Basic logging if nothing else provided
//Copyright WyattERP.org; See license in root of this package
// -----------------------------------------------------------------------------
//TODO:
//Usage: export NODE_DEBUG=db //for console debugging
//-

@@ -6,0 +6,0 @@ var logger = require('util').debuglog('db')

{
"name": "wyseman",
"version": "1.0.21",
"version": "1.0.22",
"description": "PostgreSQL Schema Manager with Javascript, Ruby, TCL API",

@@ -29,3 +29,3 @@ "main": "lib/index.js",

"wmrestore": "bin/wmrestore",
"wyseman": "bin/wyseman",
"wyseman": "bin/wyseman.js",
"wmmkpkg": "bin/wmmkpkg",

@@ -38,7 +38,8 @@ "wysegi": "bin/wysegi"

"pg-format": "^1.0.4",
"pg-native": "^3.0.0",
"ws": "^7.5.5"
},
"devDependencies": {
"mocha": "^7.2.0"
"mocha": "^9.1.3"
}
}

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