node-red-contrib-orm-objection 1.0.0

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

npm install node-red-contrib-orm-objection

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

  • 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.

Node Info

Version: 1.0.0
Updated 4 years, 11 months ago
Rating: 0.0

Categories

Actions

Rate:

Downloads

2 in the last week

Nodes

  • ORM-DB-Server
  • Objection-ORM

Keywords

  • node-red
  • orm
  • objection
  • mysql

Maintainers