electrode-ota-server-plus-dao-mariadb
v4.4.24-beta.1
Published
Electrode OTA - MariaDB driver
Downloads
3
Maintainers
Readme
electrode-ota-server-plus-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-plus-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-plus-dao-plugin" : {
module : "electrode-ota-server-plus-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
Run build (compiles typescript)
% npm run build