1.2.0 • Published 9 years ago

@ubc-farm/knex-connection v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 years ago

@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 mode
  • sql_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.

1.2.0

9 years ago

1.1.0

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago