Socket
Socket
Sign inDemoInstall

jeefo-mysql

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jeefo-mysql - npm Package Compare versions

Comparing version 0.0.38 to 0.0.39

20

index.js

@@ -29,20 +29,17 @@ /* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

constructor(table_name, config) {
if (! is.object(config)) {
throw new TypeError("Invalid argument");
}
if (! is.object(config)) throw new TypeError("Invalid argument");
this.table_name = table_name;
this.connection = mysql.createConnection(config);
this.is_connected = false;
this.config = () => config;
this.table_name = table_name;
}
connect() {
if (this.connection) return;
if (this.pending) return this.pending;
this.pending = new Promise((resolve, reject) => {
this.connection = mysql.createConnection(this.config());
this.connection.connect(err => {
this.pending = null;
if (err) return reject(err);
this.is_connected = true;
resolve();
err ? reject(err) : resolve();
//const {threadId} = this.connection;

@@ -58,3 +55,2 @@ //console.log(`[Jeefo MySQL] connceted thread id: [${threadId}].`);

return new Promise((resolve, reject) => this.connection.end(err => {
this.is_connected = false;
err ? reject(err) : resolve();

@@ -68,3 +64,3 @@ //const {threadId} = this.connection;

this.connection.destroy();
this.is_connected = false;
this.connection = null;
}

@@ -166,3 +162,3 @@

return new Promise(async (resolve, reject) => {
if (!this.is_connected) await this.connect();
if (!this.connection) await this.connect();

@@ -169,0 +165,0 @@ //console.log(`[Jeefo MySQL] exec query: ${query}`);

2

package.json
{
"name": "jeefo-mysql",
"version": "0.0.38",
"version": "0.0.39",
"description": "Very simple MySQL connection instances for each table. I had annoyed enough for MySQL Deadlocks.",

@@ -5,0 +5,0 @@ "main": "index.js",

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