@ubc-farm/knex-connection
v1.2.0
Published
Default knex connection configuartion for ubc-farm packages
Downloads
9
Readme
@ubc-farm/knex-connection
Creates a knex connection object for convience in other ubc-farm modules. Additionally exports a plugin used by @ubc-farm/server.
/index.js
Knex connection object. See knexjs.org.
/knexfile
Configuration object used by knex. Can also be used by knex command line API. Some database paths are supplied by the config object in package.json:
sqlite_file
: Path to sqlite3 database used in development modesql_connection
: Connection string for MySQL or MariaDB, used in production mode.
/plugin
Plugin for Hapi servers. Decorates a server with two methods:
server.knex()
Alias for the knex connection object.
reply.knex(knex => Promise)
Reply decorator that calls the given function, using the knex connection object as its argument. Supports promises, and any rejected promises will result in a Hapi server error reply.