newline-db
v0.1.7
Published
newline-db
Downloads
9
Readme
Newline Database
This module allows to access the data of the Newline POS.
Contributin to newline-db
npm run generate
to generate the documentation
npm run test
to run tests
npm run cover
to run the coverage
Compile typescript: tsc
Using this module in other modules
- To use the
newline-db
classes in a TypeScript file -
let db = new PouchDB("default");
const customers = new Customers(db, Customer);
customers.insert({ mobile : "6465490561" }).then((c) => {
console.log(c.mobile)
}).catch(_.noop);
Configure mySQL
- One time: in MySQL workbench click file - run script etl/tables.sql - refresh all to create tables
- One time. Change config.numMocks if you want and uncomment deleteMocks if you want: tsc etl/mocks.ts
- One time: node etl/mocks.js
- tsc etl/script.ts
- node etl/script.js
Installing CouchDB
see http://docs.couchdb.org/en/master/install/unix.html
apt-get install apt-transport-https ca-certificates
echo "deb https://apache.bintray.com/couchdb-deb stretch main" | sudo tee -a /etc/apt/sources.list
curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -
sudo apt-get update && sudo apt-get install couchdb
select 0.0.0.0 (or update in /opt/couchdb/etc/local.ini the binding ip)