English | 简体中文

api-docs / me.liuwj.ktorm.database

Package me.liuwj.ktorm.database

Entry of Ktorm framework, providing basic features of connection and transaction management.

Types

NameSummary

CachedRowSet

open class CachedRowSet : ResultSet

Special implementation of ResultSet, used to hold the query results for Ktorm.

Database

class Database

The entry class of Ktorm, represents a physical database, used to manage connections and transactions.

JdbcTransactionManager

class JdbcTransactionManager : TransactionManager

TransactionManager implementation based on JDBC.

SpringManagedTransactionManager

class SpringManagedTransactionManager : TransactionManager

TransactionManager implementation that delegates all transactions to the Spring framework.

SqlDialect

interface SqlDialect

Representation of a SQL dialect.

Transaction

interface Transaction : Closeable

Representation of a transaction.

TransactionIsolation

enum class TransactionIsolation

Enum class represents transaction isolation levels, wrapping the TRANSACTION_XXX constants
defined in the Connection interface.

TransactionManager

interface TransactionManager

Transaction manager abstraction used to manage database connections and transactions.

Exceptions

NameSummary

DialectFeatureNotSupportedException

class DialectFeatureNotSupportedException : 
    UnsupportedOperationException

Thrown to indicate that a feature is not supported by the current dialect.

Extensions for External Classes

NameSummary

java.sql.PreparedStatement

Functions

NameSummary

iterable

fun <T : ResultSet> T.iterable(): Iterable<T>

Wrap this ResultSet as Iterable.

iterator

operator fun <T : ResultSet> T.iterator(): Iterator<T>

Return an iterator over the rows of this ResultSet.

use

fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R

Execute the given block function on this resource and then close it down correctly whether an exception
is thrown or not.

useConnection

fun <T> useConnection(func: (Connection) -> T): T

Obtain a connection from Database.global and invoke the callback function with it.

useTransaction

fun <T> useTransaction(
    isolation: TransactionIsolation = TransactionIsolation.REPEATABLE_READ,
    func: (Transaction) -> T
): T

Execute the specific callback function in a transaction of Database.global and returns its result if the
execution succeeds, otherwise, if the execution fails, the transaction will be rollback.