RightTrackDB

RightTrackDB

RightTrackDB Implementation

This Class is an implementation of the abstract RightTrackDB Class.

This implementation uses the sql.js javascript module to provide the actual SQLite functionality.

NOTE: This class is designed to use the Web Worker version of sql.js

Constructor

new RightTrackDB(agencyConfig, array)

Source:

Right Track Database Constructor

Parameters:
Name Type Description
agencyConfig Object

The configuration of the Right Track Agency

array Array

A Uint8Array containing the database data

Methods

get(statement, callback)

Source:

Select a single row from the database. If no results are selected, this will return undefined. If more than 1 results are selected it will return the first result.

Parameters:
Name Type Description
statement string

Select Statement

callback function

getCallback callback function

select(statement, callback)

Source:

Select multiple rows from the database

Parameters:
Name Type Description
statement string

Select Statement

callback function

selectCallback callback function

Type Definitions

getCallback(error, rowopt)

Source:

This callback is performed after performing a SELECT query that will return the first row.

Parameters:
Name Type Attributes Description
error Error

Database Query Error

row object <optional>

First selected row

selectCallback(error, rowsopt)

Source:

This callback is performed after performing a SELECT query that can return multiple rows.

Parameters:
Name Type Attributes Description
error Error

Database Query Error

rows Array.<object> <optional>

Selected rows