Initialize the DataContext.
Manages the connection pool.
Used for escaping queries.
Used for executing queries.
Begin a transaction.
transFunc shall be resolved with type R, and this function will proxy the return when transFunc completes.
A user-supplied function that will be called with a MySQLTransactionalDataContext instance. All queries executed against the MySQLTransactionalDataContext will be part of the transaction. The user-supplied function should return a promise. If that promise is resolved then the transaction will be committed, otherwise it will be rolled back. The return of transFunc is returned from beginTransaction.
A promise that will be rejected if there is an error when beginning the transaction.
Connect to the database.
Connection options for setting up a connection to the database.
A promise that will be resolved with this MySQLDataContext instance.
Create a new DeleteModel instance that can be used to delete a model by ID. For complex delete operations, use the DataContext.from method to obtain a FromAdapter instance, and then call FromAdapter.delete on that instance.
The type of model to delete, which is the constructor of a Table-decorated class.
An Entity instance to delete, which must have the primary key set.
A DeleteModel instance that can be executed using DeleteModel.execute.
End the connection pool.
Create a new MySQLFromAdapter instance, which can then be used to select, update, or delete.
A Table-decorated entity which is the constructor of the FROM table.
Alias for the FROM table, used in conditions, joins, and column selection. Optional: defaults to the name of the table.
A MySQLFromAdapter that implements MySQLFromAdapter.select, MySQLFromAdapter.update, and MySQLFromAdapter.delete.
Get a MySQLEscaper instance for escaping column and table names.
Get a MySQLExecuter instance that can be used to execute queries.
Create and return a new Insert instance.
The type of model to insert, which is the constructor of a Table-decorated class.
An Entity instance to insert.
An Insert instance that can be executed using Insert.execute.
Rollback a transaction. This method is only implemented in concrete DataContexts that are tied to a transaction. For example, MySQLTransactionalDataContext.
Create a new MySQLUpdateModel instance that can be used to update a model by ID. For complex update operations, use the MySQLDataContext.from method to obtain a MySQLFromAdapter instance, and then call MySQLFromAdapter.update on that instance.
The type of model to update, which is the constructor of a Table-decorated class.
An Entity instance to update, which must have the primary key set.
An MySQLUpdateModel instance that can be executed using MySQLUpdateModel.execute.
Generated using TypeDoc
A DataContext class specialized for MySQL.