Kysely
The main Kysely class for interacting with your database. You should create one instance ofKysely per database using the constructor. Each Kysely instance maintains its own connection pool.
Constructor
Configuration object for Kysely instance
Example
Properties
schema
SchemaModule for building database schema.
Example:
dynamic
DynamicModule for bypassing strict typing and passing dynamic values.
Example:
introspection
fn
FunctionModule for building SQL function calls.
Example:
isTransaction
true if this Kysely instance is a transaction. You can also use db instanceof Transaction.
Methods
selectFrom
QueryCreator. See SelectQueryBuilder for available methods.
insertInto
updateTable
deleteFrom
transaction
TransactionBuilder for running queries inside a transaction.
The callback function passed to execute() gets the transaction object as its only argument. If the function throws, the transaction is rolled back. Otherwise it’s committed.
Example:
startTransaction
ControlledTransactionBuilder for manually controlled transactions.
Returns a ControlledTransaction that allows manual commit/rollback and savepoint operations.
Example:
connection
case
case statement/operator.
See ExpressionBuilder.case for more information.
withPlugin
withoutPlugins
withSchema
withTables
executeQuery
destroy
Kysely instance.
Example: