Package Exports
- electrode-ota-server-dao-mariadb
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (electrode-ota-server-dao-mariadb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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-mariadbUpdate 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-dbRun tests in this directory
% npm run test