Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

electrode-ota-server-dao-mariadb

4.4.17 • Public • Published

electrode-ota-server-dao-mariadb

An implementation of the Electrode OTA Server's data access layer using MariaDB as a back-end.

Usage

In your electrode ota server implementation, include this module as a dependency.

npm install --save electrode-ota-server-dao-mariadb

Update your OTA server configuration to override the DAO plugin. This is assuming your config is in JavaScript format (not JSON).

const conf = {
    plugins : {
        // ...
 
        "electrode-ota-server-dao-plugin" : {
            module : "electrode-ota-server-dao-mariadb",
            // connection options based on typeorm;
            // 'type' and 'entities' are defaulted but may be overriden
            options : {
                clusterConfig : {
                    canRetry : true,
                    defaultSelector : "ORDER",
                    removeNodeErrorCount : 5,
                    restoreNodeTimeout : 0,
                },
                poolConfigs : [{
                    database: "bento_ota",
                    host: "localhost",
                    password: "password",
                    port: 3306,
                    user: "user",
                }],
            }
        },
 
        // ...
    }
}

The clusterConfig is the settings for the mysql PoolCluster options.

The poolConfigs property is an array of Connection options.

The database schema can be found at electrode-ota-mariadb-schema

To run tests

Start docker MariaDB in electrode-ota-mariadb-schema

% docker-compose up ota-db

Run tests in this directory

% npm run test

install

npm i electrode-ota-server-dao-mariadb

Downloadsweekly downloads

0

version

4.4.17

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability