← Back to Stormify Documentation

Connection

A connection to a specific database, used to execute statements and manage transactions.

Properties

Link copied to clipboard

Metadata about the database product name, version, and capabilities.

Functions

Link copied to clipboard
open fun cancel()

Best-effort asynchronous cancellation of any statement currently executing on this connection. Designed to be called from a thread OTHER than the one blocked inside a kdbc call — that is the point: higher-level code (e.g. a Kotlin coroutine cancellation handler) can interrupt a running query without waiting for it.

Link copied to clipboard

Driver-specific recovery after cancel has interrupted a blocking call. Invoked by the coroutine cancellation path on the thread that owned the blocking call, once that call has returned with an error.

Link copied to clipboard
abstract fun commit()

Commits the current transaction.

Link copied to clipboard
abstract fun initStatement(sql: String, returnGeneratedKeys: Boolean, columnNames: Array<String>?): Statement

Creates a prepared statement for the given SQL. Set returnGeneratedKeys to retrieve auto-generated keys after execution.

Link copied to clipboard

Creates a callable statement for invoking stored procedures.

Link copied to clipboard
abstract fun releaseSavepoint(savepoint: Savepoint)

Releases a savepoint, freeing database resources.

Link copied to clipboard
abstract fun rollback(savepoint: Savepoint? = null)

Rolls back the current transaction, optionally to a specific savepoint.

Link copied to clipboard
abstract fun setAutoCommit(autoCommit: Boolean)

Enables or disables auto-commit mode. When disabled, changes must be explicitly committed.

Link copied to clipboard
abstract fun setSavepoint(name: String): Savepoint

Creates a named savepoint within the current transaction.