STOLLC ORACLE HELPERS
A small library that helps maintain stopllc oracle helpers
Installation
npm install --save stopllc_oracle
Usage ES6 style
import BaseModel from 'stopllc_oracle/lib/BaseModel';
const ClassName extends BaseModel {
constructor(){
//call super
super(); //initiates default id field
// define fields.
// name = '';
}
}
const className = new ClassName();
// create loopback data source
const read = className.readDataSource('schema');
read.find(); //loopback
className.write('schema'); //custom procedures
className.read('schema'); //custom read procedures
BASEMODEL overwritable methods
get readData() {
// gets properties
return this;
}
get ignoreRead() {
return ['']; //ignores fields in array when reading using loopback .find()
}
get readProcData() {
return this;
}
get writeData() {
return this;
}
get readProcedureName() {
//gets procedure name for oracle
return this.constructor.name + 'ReadProc';
}
get procedureName() {
//gets procedure name for oracle
return this.constructor.name + 'Write';
}
get viewName() {
//gets view name for oracle
return this.constructor.name + 'Read';
}
get validate() {
return true;
}