feat(constructor): detect knex on construction #1756
Merged
Conversation
src/bookshelf.js
Outdated
@@ -24,6 +24,9 @@ import Errors from './errors'; | |||
* @param {Knex} knex Knex instance. | |||
*/ | |||
function Bookshelf(knex) { | |||
if (!knex || !knex.__knex__) { |
ricardograca
Feb 7, 2018
Member
This started throwing a warning when running tests:
Knex:warning - knex.__knex__ is deprecated, you can get the module versionby running require('knex/package').version
Can you look into it?
This started throwing a warning when running tests:
Knex:warning - knex.__knex__ is deprecated, you can get the module versionby running require('knex/package').version
Can you look into it?
cdaringe
Feb 7, 2018
Author
Contributor
yep. sorry i missed that.
yep. sorry i missed that.
BREAKING CHANGE: although uncommon and unlikely, invalid construction was permissible in the past. now, we eagerly throw. this has a low but feasible chance of breaking some existing installs/usages.
9e3ab74
to
4906279
|
Many thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Introduction
a bad knex arg is allowed on construction
Motivation
fail fast
Proposed solution
disallow a bad knex arg on construction