A gesundheit query must be “bound” to an “engine” to render and/or execute. For apps that deal with a single database, you can simply create an engine instance during application startup, assign it to gesundheit.defaultEngine and not have to think about binding after that.
Engine is gesundheits interface to an actual database.
Engines have all of the query factory functions attached to them as instance methods that automatically bind created queries to the engine. They also have these additionaly methods
Create an Engine instance from an Any-DB connect string and extra connection pool options, this is exported by gesundheit as gesundheit.engine(...).
This example shows the most common way to set up a single default database engine for an application.
Passes arguments directly to the query method of the underlying Any-DB ConnectionPool
Start a new transaction and return it.
The returned object behaves exactly like a new engine, but has commit and rollback methods instead of close. (In fact it’s an Any-DB Transaction that has had the query factory functions mixed in to it).
Render an AST to a SQL string and collect parameters
Closes the internal connection pool.
Create a fake database connection pool that throws errors if you try to execute a query.