Socket
Socket
Sign inDemoInstall

node-red-contrib-orm-objection

Package Overview
Dependencies
315
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 1.1.1 (2020-11-02)
- Fixed database connections: there was one connection per node, but only the last one was closed. Sorry for that!
## 1.1.0 (2020-10-21)

@@ -2,0 +6,0 @@

2

package.json

@@ -35,3 +35,3 @@ {

},
"version": "1.1.0"
"version": "1.1.1"
}

@@ -12,21 +12,23 @@ module.exports = (RED) => {

this.connect = async () => {
this.emit('state', 'connecting');
knex = Knex({
client: 'mysql2',
connection: {
host: config.host,
port: config.port,
user: config.user,
password: config.password,
database: config.database,
timezone : "+00:00",
dateStrings: true,
},
...knexSnakeCaseMappers(),
});
if (!knex) {
console.log("ObjectionORM: connect");
this.emit('state', 'connecting');
knex = Knex({
client: 'mysql2',
connection: {
host: config.host,
port: config.port,
user: config.user,
password: config.password,
database: config.database,
timezone : "+00:00",
dateStrings: true,
},
...knexSnakeCaseMappers(),
});
// Give the knex object to Objection.
// Give the knex object to Objection.
Model.knex(knex);
}
Model.knex(knex);
await knex.select(knex.raw('1'));

@@ -37,2 +39,3 @@ this.emit('state', 'connected');

this.on('close', async done => {
console.log("ObjectionORM: close");
knex.destroy();

@@ -39,0 +42,0 @@ this.emit('state');

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc