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

    node-red-contrib-orm-objection

A Node-RED node to use the Objection ORM to connect to a MySQL database.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

1.1.2 (2020-11-02)

  • Fixed database connections: there was one connection per node, but only the last one was closed. Sorry for that!

Readme

Source

node-red-contrib-orm-objection

Node-RED node to query a MySQL database with the Objection ORM.

Official repository: https://github.com/frederic-bonjour/node-red-contrib-orm-objection

Installation

  • Install this Node from the Node-RED palette.
  • Create a JS file that describes all your models (see Objection doc). This file must export an object with the model names as keys.
  • In the settings.js file of your Node-RED installation, import this file in the functionGlobalContext section :
functionGlobalContext: {
    // os:require('os'),
    objectionModels: require('./models')
},

(Of course, change the ./models path to suit your needs.)

Finally, restart Node-RED.

Usage

Select

  • Insert a storage/Objection ORM into your Flow and configure the database connection.
  • Optionnaly select a Model name (or use msg.topic in the incoming message).
  • Optionnaly select the graph to be fetched along with the model (or use msg.graph in the incoming message).

The incoming message may contains the following properties:

  • where: an object representing the WHERE clause.
  • byId: an integer or a String that will be used in the findById() method.
  • orderBy: a String to choose on which column the results should be sorted on.

Patch (update)

  • Insert a storage/Objection ORM into your Flow and configure the database connection.
  • Select a Model name.
  • Optionnaly select the graph to be fetched along with the model (or use msg.graph in the incoming message).

The incoming message must contain the following property:

  • patch: an object with the 2 properties:
    • id: ID of the model to patch
    • props: object containing the properties to update

Keywords

FAQs

Last updated on 12 Jan 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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