DmlCommand

data class DmlCommand(action: DmlAction, targetUniqueId: String, rows: Iterable<ExprValue>) : QueryResult

The result of a INSERT or DELETE statement. (UPDATE is out of scope for now.)

Each instance of a DML command denotes an operation to be performed by the embedding PartiQL application to effect the writes specified by a DML operation.

The primary benefit of this class is that it ensures that the rows property is evaluated lazily. It also provides a cleaner API that is easier to work with for PartiQL embedders. Without this, the user would have to consume the ExprValue directly and convert it to Ion. Neither option is particularly developer friendly, efficient or maintainable.

This is currently only factored to support INSERT INTO and DELETE FROM as UPDATE and FROM ... UPDATE is out of scope for the current effort.

Constructors

Link copied to clipboard
fun DmlCommand(action: DmlAction, targetUniqueId: String, rows: Iterable<ExprValue>)

Properties

Link copied to clipboard
val action: DmlAction

Identifies the action to take.

Link copied to clipboard
val rows: Iterable<ExprValue>

The rows to be inserted or deleted.

Link copied to clipboard
val targetUniqueId: String

The unique identifier of the table targed by the DML statement.