English | 简体中文

api-docs / org.ktorm.support.postgresql

Package org.ktorm.support.postgresql

PostgreSQL dialect module for Ktorm.

Types

NameSummary

HStoreExpression

data class HStoreExpression<T : Any> : ScalarExpression<T>

Expression class represents PostgreSQL’s hstore operations.

HStoreExpressionType

enum class HStoreExpressionType

Enum for hstore operators.

HStoreSqlType

object HStoreSqlType : SqlType<HStore>

SqlType implementation represents PostgreSQL hstore type.

ILikeExpression

data class ILikeExpression : ScalarExpression<Boolean>

ILike expression, represents PostgreSQL’s ilike keyword.

InsertOrUpdateExpression

data class InsertOrUpdateExpression : SqlExpression

Insert or update expression, represents an insert statement with an
on conflict (key) do update set clause in PostgreSQL.

InsertOrUpdateStatementBuilder

class InsertOrUpdateStatementBuilder : 
    PostgreSqlAssignmentsBuilder

DSL builder for insert or update statements.

PgEnumType

class PgEnumType<C : Enum<C>> : SqlType<C>

SqlType implementation represents PostgreSQL enum type.

PostgreSqlAssignmentsBuilder

open class PostgreSqlAssignmentsBuilder : AssignmentsBuilder

Base class of PostgreSQL DSL builders, provide basic functions used to build assignments for insert or update DSL.

PostgreSqlDialect

open class PostgreSqlDialect : SqlDialect

SqlDialect implementation for PostgreSQL database.

PostgreSqlExpressionVisitor

open class PostgreSqlExpressionVisitor : SqlExpressionVisitor

Base class designed to visit or modify PostgreSQL’s expression trees using visitor pattern.

PostgreSqlFormatter

open class PostgreSqlFormatter : SqlFormatter

SqlFormatter implementation for PostgreSQL, formatting SQL expressions as strings with their execution arguments.

TextArraySqlType

object TextArraySqlType : SqlType<TextArray>

SqlType implementation represents PostgreSQL text[] type.

Type Aliases

NameSummary

HStore

typealias HStore = Map<String, String?>

Represent values of PostgreSQL hstore SQL type.

TextArray

typealias TextArray = Array<String?>

Represent values of PostgreSQL text[] SQL type.

Functions

NameSummary

containedIn


fun ColumnDeclaring<HStore>.containedIn(
    argument: HStore
): HStoreExpression<Boolean>

HStore contained in operator, translated to the <@ operator in PostgreSQL.

contains


fun ColumnDeclaring<HStore>.contains(
    argument: HStore
): HStoreExpression<Boolean>

HStore contains operator, translated to the @> operator in PostgreSQL.

containsAll


fun ColumnDeclaring<HStore>.containsAll(
    argument: TextArray
): HStoreExpression<Boolean>

HStore contains all keys operator, translated to the ?& operator in PostgreSQL.

containsAny


fun ColumnDeclaring<HStore>.containsAny(
    argument: TextArray
): HStoreExpression<Boolean>

HStore contains any keys operator, translated to the ?| operator in PostgreSQL.

containsKey


fun ColumnDeclaring<HStore>.containsKey(
    argument: String
): HStoreExpression<Boolean>

HStore contains key operator, translated to the ? operator in PostgreSQL.

get


operator fun ColumnDeclaring<HStore>.get(
    argument: String
): HStoreExpression<String>

HStore get value for key operator, translated to the -> operator in PostgreSQL.


operator fun ColumnDeclaring<HStore>.get(
    argument: TextArray
): HStoreExpression<TextArray>

HStore get values for keys operator, translated to the -> operator in PostgreSQL.

hstore

fun <E : Any> BaseTable<E>.hstore(
    name: String
): Column<HStore>

Define a column typed HStoreSqlType.

ilike

infix fun ColumnDeclaring<*>.ilike(
    expr: ColumnDeclaring<String>
): ILikeExpression

infix fun ColumnDeclaring<*>.ilike(
    argument: String
): ILikeExpression

ILike operator, translated to the ilike keyword in PostgreSQL.

insertOrUpdate

fun <T : BaseTable<*>> T.insertOrUpdate(
    block: InsertOrUpdateStatementBuilder.(T) -> Unit
): Int

fun <T : BaseTable<*>> Database.insertOrUpdate(
    table: T,
    block: InsertOrUpdateStatementBuilder.(T) -> Unit
): Int

Insert a record to the table, determining if there is a key conflict while it’s being inserted, and automatically
performs an update if any conflict exists.

minus

operator fun ColumnDeclaring<HStore>.minus(
    expr: ColumnDeclaring<String>
): HStoreExpression<HStore>

operator fun ColumnDeclaring<HStore>.minus(
    argument: String
): HStoreExpression<HStore>

HStore delete key operator, translated to the - operator in PostgreSQL.


operator fun ColumnDeclaring<HStore>.minus(
    argument: TextArray
): HStoreExpression<HStore>

HStore delete keys operator, translated to the - operator in PostgreSQL.

operator fun ColumnDeclaring<HStore>.minus(
    expr: ColumnDeclaring<HStore>
): HStoreExpression<HStore>

operator fun ColumnDeclaring<HStore>.minus(
    argument: HStore
): HStoreExpression<HStore>

HStore delete matching pairs operator, translated to the - operator in PostgreSQL.

pgEnum

fun <C : Enum<C>> BaseTable<*>.pgEnum(
    name: String
): Column<C>

Define a column typed of PgEnumType.
!Note Enums are case sensitive and must match what is in the db

plus

operator fun ColumnDeclaring<HStore>.plus(
    expr: ColumnDeclaring<HStore>
): HStoreExpression<HStore>

operator fun ColumnDeclaring<HStore>.plus(
    argument: HStore
): HStoreExpression<HStore>

HStore concatenate operator, translated to the || operator in PostgreSQL.

textArray

fun <E : Any> BaseTable<E>.textArray(
    name: String
): Column<TextArray>

Define a column typed TextArraySqlType.