English | 简体中文

api-docs / org.ktorm.support.sqlite / BulkInsertExpression

BulkInsertExpression

data class BulkInsertExpression : SqlExpression (source code)

Bulk insert expression, represents a bulk insert statement in SQLite.

For example:

insert into table (column1, column2)
values (?, ?), (?, ?), (?, ?)...
on conflict (...) do update set ...`

Constructors

NameSummary

<init>

BulkInsertExpression(
    table: TableExpression,
    assignments: List<List<ColumnAssignmentExpression<*>>>,
    conflictColumns: List<ColumnExpression<*>> = emptyList(),
    updateAssignments: List<ColumnAssignmentExpression<*>> = emptyList(),
    where: ScalarExpression<Boolean>? = null,
    returningColumns: List<ColumnExpression<*>> = emptyList(),
    isLeafNode: Boolean = false,
    extraProperties: Map<String, Any> = emptyMap())

Bulk insert expression, represents a bulk insert statement in SQLite.

Properties

NameSummary

assignments

val assignments: List<List<ColumnAssignmentExpression<*>>>

column assignments of the bulk insert statement.

conflictColumns

val conflictColumns: List<ColumnExpression<*>>

the index columns on which the conflict may happen.

extraProperties

val extraProperties: Map<String, Any>

Extra properties of this expression, maybe useful in SqlFormatter to generate some special SQLs.

isLeafNode

val isLeafNode: Boolean

Check if this expression is a leaf node in expression trees.

returningColumns

val returningColumns: List<ColumnExpression<*>>

the returning columns.

table

val table: TableExpression

the table to be inserted.

updateAssignments

val updateAssignments: List<ColumnAssignmentExpression<*>>

the updated column assignments while key conflict exists.

where

the condition whether the update assignments should be executed.

Extension Functions

NameSummary

eq

infix fun <T : Any> T.eq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Equal operator, translated to = in SQL.

neq

infix fun <T : Any> T.neq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Not-equal operator, translated to <> in SQL.

notEq

infix fun <T : Any> T.notEq(
    expr: ColumnDeclaring<T>
): BinaryExpression<Boolean>

Not-equal operator, translated to <> in SQL.