The "connection" object is set on the runner when "run" is called.
"Run" the target, calling "toSQL" on the builder, returning an object or array of queries to run, each of which are run on a single connection.
Stream the result set, by passing through to the dialect's streaming capabilities. If the options are
If we specify stream(handler).then(...
Lazy-load the "PassThrough" dependency.
If a function is passed to handle the stream, send the stream there and return the promise, otherwise just return the stream and the promise will take care of itsself.
Allow you to pipe the stream to a writable stream.
"Runs" a query, returning a promise. All queries specified by the builder are guaranteed to run in sequence, and on the same connection, especially helpful when schema building and dealing with foreign key constraints, etc.
In the case of the "schema builder" we call queryArray, which runs each
of the queries in sequence.
Check whether there's a transaction flag, and that it has a connection.
"Debug" the query being run.
Check whether we're "debugging", based on either calling debug on the query.
Run the transaction on the correct "runner" instance.
Begins a transaction statement on the instance, resolving with the connection of the current transaction.
Finishes the transaction statement and handles disposing of the connection,
resolving / rejecting the transaction's promise, and ensuring the transaction object's
_runner property is null'ed out so it cannot continue to be used.
Run the query to commit / rollback the transaction.
If there was a problem committing the transaction, reject the transaction block (to reject the entire transaction block), then re-throw the error for any promises chained off the commit.
Kill the "_runner" object on the containerObject, so it's not possible to continue using the transaction object.
Cleanup the connection as necessary, if the _connection was
explicitly set on the query we don't need to do anything here,
otherwise we
The "Runner" constructor takes a "builder" (query, schema, or raw) and runs through each of the query statements, calling any additional "output" method provided alongside the query and bindings.