(c) 2013 Tim Griesser
Knex may be freely distributed under the MIT license.
For details and documentation:
http://knexjs.org
Base library dependencies of the app.
Require the main constructors necessary for a Knex
instance,
each of which are injected with the current instance, so they maintain
the correct client reference & grammar.
The Knex
module, taking either a fully initialized
database client, or a configuration to initialize one. This is something
you'll typically only want to call once per application cycle.
If the client isn't actually a client, we need to configure it into one. On the client, this isn't acceptable, since we need to return immediately rather than wait on an async load of a client library.
Enables the knex('tableName')
shorthand syntax.
Main namespaces for key library components.
Enable the Builder('tableName')
syntax, as is used in the main knex('tableName')
.
Attach each of the Schema
"interface" methods directly onto to knex.schema
namespace, e.g.:
knex.schema.table('tableName', function() {...
knex.schema.createTable('tableName', function() {...
knex.schema.dropTableIfExists('tableName');
Method to run a new Raw
query on the current client.
Keep a reference to the current client.
Keep in sync with package.json
Runs a new transaction, taking a container and returning a promise for when the transaction is resolved.
Attach each of the Migrate
"interface" methods directly onto to knex.migrate
namespace, e.g.:
knex.migrate.latest().then(...
knex.migrate.currentVersion(...
Return the new Knex
instance.
The client names we'll allow in the {name: lib}
pairing.
Used primarily to type-check a potential Knex
client in Bookshelf.js
,
by examining whether the object's client
is an instanceof Knex.ClientBase
.
finally, export the Knex
object for node and the browser.
Knex.js 0.5.0