Skip to content

Commit

Permalink
Support objection v2. Resolves #73
Browse files Browse the repository at this point in the history
  • Loading branch information
devinivy committed Dec 1, 2019
1 parent de2f5ad commit bf65ea6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# API

> **Note**
>
> Schwifty is intended for use with hapi v17+, joi v14 and v15, Objection v1 and v2, knex v0.8+, and nodejs v8+.
## The hapi plugin
### Registration
Schwifty may be registered multiple times—it should be registered in any plugin that would like to use any of its features. Upon each registration these options are collected until server initialization. Models and knex configurations passed during configuration are attributed to the registering plugin/server under schwifty's [ownership system](#plugin-ownership-of-knex-instances-and-models). The model(s) `name` must be unique across the entire server. Server initialization will fail if any knex instances handled by schwifty do not have basic database connectivity.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Lead Maintainer - [Devin Ivy](https://github.com/devinivy)
Schwifty is used to define [Joi](https://github.com/hapijs/joi)-compatible models and knex connections for use with Objection ORM. Those models then become available within your hapi server where it is most convenient. It has been tailored to multi-plugin deployments, where each plugin may set clear boundaries in defining its own models, knex database connections, and migrations. It's safe to register schwifty multiple times, wherever you'd like to use it, as it protects against model name collisions and other ambiguous configurations.

> Note, this library is intended to work with **hapi v17+** and **Objection v1** (see `peerDependencies` in our package.json).
> **Note**
>
> Schwifty is intended for use with hapi v17+, joi v14 and v15, Objection v1 and v2, knex v0.8+, and nodejs v8+.
>
> Schwifty v4 introduced compatibility with Objection v1. If you prefer or need to work with earlier versions of Objection, checkout Schwifty v3 instead!
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
"@hapi/hapi": ">=17 <19",
"@hapi/joi": ">=14 <16",
"knex": ">=0.8",
"objection": ">=1 <2"
"objection": ">=1 <3"
},
"devDependencies": {
"@hapi/code": "6.x.x",
"@hapi/hapi": "18.x.x",
"@hapi/lab": "20.x.x",
"coveralls": "3.x.x",
"knex": "0.20.x",
"objection": "1.x.x",
"objection": "2.x.x",
"sqlite3": "4.x.x"
},
"author": "William Woodruff <bill@bigroomstudios.com>",
Expand Down

0 comments on commit bf65ea6

Please sign in to comment.