Database

Database

Application database automatically configured from config/index.js.

Constructor

new Database()

Source:
See:
Properties:
Name Type Description
knex Knex

A Knex instance which can be used to run queries.

bookshelf Bookshelf

A Bookshelf instance which can be used to manage models.

st PostGIS

An instance of the knex-postgis extension, which has useful functions to work with PostGIS types when making queries, such as st.asGeoJSON(column).

Methods

close()

Source:

Closes the database connection pool.

open() → {Promise}

Source:

Ensures that a database connection is open.

Returns:

A promise that will be resolved if a database connection was successfully established.

Type
Promise