• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

joelmukuthu / knorm / 337
98%
master: 98%

Build:
Build:
LAST BUILD BRANCH: greenkeeper/sinon-5.0.3
DEFAULT BRANCH: master
Ran 19 Feb 2018 09:51PM UTC
Jobs 1
Files 11
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
337

push

travis-ci

joelmukuthu
refactor(Query): complete rewrite

This commit completely rewrites the `Query` class to improve performance and
make it easy to overload its methods, particularly the methods for preparing
the query-builder. It also adds proxy methods for most of the query-builder
methods e.g. `where`, `having`, `group`, `max` etc.

In line with improving performance, this commit removes several debug-specific
checks. These will be added back later with a debug config that doesn't affect
perfomance.

BREAKING CHANGE: Removed checks:
- Removed `Query.errors`. Errors are now exported directly as `Query` statics
  e.g. `Query.QueryError`, `Query.FetchError`
- Removed support for `fields` with Field instances:
  `.fetch({ fields: Model.fields })`, `.fields(Model.fields)`
- Removed support for `returning` with Field instances:
  `.insert({ foo: 'bar' }, { returning: Model.fields })`,
  `.returning(Model.fields)`
- Removed validation of fields for all Query methods:
  `.fetch({ where: { unknownField: 'foo' } })` will throw
- Removed casting of aliased fields: if a field has a post-fetch cast function
  it won't be cast of the field is aliased in a fetch
- Removed support for `.where({ field: [] })` to mean "where field in array".
  `where` is now just a proxy to knex's query builder's `where`
- Removed support for `having` with object values i.e. `.having({ id: 1 })`.
  `having` is now just a proxy to knex's query builder's `having`
- Removed the `within` alias for `transaction`
- Removed the check against doing a fetch on a joined query
- Removed support for the `on` option with Field instances:
  `.on(Model.fields.id)`
- Removed support for the `field` option with Field instances:
  `.field(Model.fields.id)`
- Removed support for `distinct` with field instances:
  `.distinct(Model.fields.id)`
- Removed check against `insert` and `update` with non-object values
- Removed check against `insert` and `update` with instances of a different
  model

Also:
- Fixed the `lean` (or... (continued)

581 of 603 branches covered (96.35%)

Branch coverage included in aggregate %.

935 of 953 relevant lines covered (98.11%)

213.12 hits per line

Jobs
ID Job ID Ran Files Coverage
1 337.1 19 Feb 2018 09:51PM UTC 0
97.43
Travis Job 337.1
Source Files on build 337
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #337
  • 28f461ca on github
  • Next Build on refactor/query-context (#339)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc