lib/persistence.js

Persistence layer
Author:
Source:

Methods

(inner) findEntity(id) → {Promise}

Return all entities with a given ID (should be unique)
Source:
Parameters:
Name Type Description
id String name of the desired ID
Returns:
Type:
Promise
found entities

(inner) listEntities(type) → {Array}

Return all entities of a given type
Source:
Parameters:
Name Type Description
type String type; use constants of the form persistence.TYPE_*
Returns:
Type:
Array
all entities of that type

(inner) retrieveRows(query, …params) → {Array}

Run a query and retrieve a set of rows from the DB
Source:
Parameters:
Name Type Attributes Description
query String the SQL query
params String <repeatable>
(optional; variable length) values to interpolate in the query
Returns:
Type:
Array
the resulting rows

(inner) setUp()

Set up persistence
Source:

(inner) wrapUp()

Terminate the DB connection (gracefully)
Source: