Larvit order library running on PostgreSQL
Generic order module for nodejs.
order data structure:
Installation
npm i larvitorder-pg
Usage
Initialize and requirements
First you need to set up a db connection. Larvitdb-pg is used here, but any compatible library will suffice.
;; const db = ...; // Se documentation on https://github.com/larvit/larvitdb-pgconst order = db ;
Save an new order
Both create and update an existing order with the same call.
To create a new order, supply a non existing uuid or omit it completley, then a new will be generated.
const order = uuid: '03250c8c-bf88-44d8-a326-b6987d3990d1' fields: firstname: 'Günter' lastname: 'Edelweiss' 'Schloffs' rows: price: '399' name: 'Screw' price: '34' name: 'teh_foo' tags: 'foo' 'bar' ; order;
Remove orders from database
order;
Load order from database
order;