There are a few subsystems that make up gesundheit, but the majority of use cases will be covered by using the following properties of the main module:
- gesundheit.{Select, SELECT, select}
- Function for creating new SelectQuery instances.
- gesundheit.{Update, UPDATE, update}
- Function for creating new UpdateQuery instances.
- gesundheit.{Delete, DELETE, delete}
- Function for creating new DeleteQuery instances.
- gesundheit.{Insert, INSERT, insert}
- Function for creating new InsertQuery instances.
- gesundheit.engine
- Function for creating new engines.
- gesundheit.defaultEngine
- The engine that will be used for queries that aren’t explicitly bound. This is set to a no-op engine that you will want to replace with either an object returned by the gesundheit.engine function or by implementing the engine interface yourself.
- Join types
- Constant nodes for use with SUDQuery.join. ‘LEFT’, ‘RIGHT’, ‘INNER’, ‘LEFT_OUTER’, ‘RIGHT_OUTER’, ‘FULL_OUTER’ ‘NATURAL’, ‘CROSS’
- AST helper functions
These come from the nodes module and are often useful when constructing complicated queries:
- toParam
- Convert any object to a parameter placeholder.
- toRelation
- Convert various inputs to Relation nodes.
- binaryOp
- Create a binary comparison node manually. (e.g. for postgres’ custom operators).
- sqlFunction
- Create SQL function calls (e.g. MAX(last_update))
- text
- Include raw SQL in a query, with parameter placeholders.
If you are implementing support for a different database engine or constructing particularly unusual SQL statements, you might also want to make use of these:
- gesundheit.nodes
- The nodes <Nodes> module.
- gesundheit.dialects
- The dialects <Dialects> module.