electrode-ota-server-dao-mariadb
TypeScript icon, indicating that this package has built-in type declarations

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

% yarn test

Run build (compiles typescript)

% yarn build

Package Sidebar

Install

npm i electrode-ota-server-dao-mariadb

Weekly Downloads

2

Version

4.8.4

License

Apache-2.0

Unpacked Size

164 kB

Total Files

85

Last publish

Collaborators

  • datvong
  • scrajesh