Some functions which are common to both the
Builder
and SchemaBuilder
classes.
Methods common to both the Grammar
and SchemaGrammar
interfaces,
used to generate the sql in one form or another.
Creates a new instance of the current Builder
or SchemaBuilder
,
with the correct current knex
instance.
Sets the flag, so that when this object is passed into the
client adapter, we know to log
the query.
Sets options
which are passed along to the database client.
For those who dislike promise interfaces.
Multiple calls to exec
will resolve with the same value
if called more than once. Any unhandled errors will be thrown
after the last block.
The promise interface for the query builder.
Returns an array of query strings filled out with the correct values based on bindings, etc. Useful for debugging.
TODO: get rid of the need to clone the object here...
Converts the current statement to a sql string
Explicitly sets the connection.
The connection the current query is being run on, optionally
specified by the connection
method.
Default handler for a response is to pass it along.
Sets the "type" of the current query, so we can potentially place
select
, update
, del
, etc. anywhere in the query statement
and have it come out fine.
Returns all bindings excluding the Knex.Raw
types.
Sets the current Builder connection to that of the the currently running transaction
Add "forUpdate" and "forShare" here, since these are only relevant within the context of a transaction.
Common