Tursox.Statement (tursox v0.2.1)

Copy Markdown View Source

A real prepared statement owned by one Tursox.Connection.

One cursor may be active at a time. Reset, execution, or a second query while that cursor is active returns :misuse rather than resetting shared engine state underneath it.

Summary

Functions

Logically closes a statement. It is safe to call repeatedly.

Returns ordered column metadata, including duplicate names.

Executes this prepared statement and returns affected-row metadata.

Starts an incremental native row cursor.

Resets a completed statement for explicit reuse.

Types

t()

@opaque t()

Functions

close(statement)

@spec close(t()) :: :ok

Logically closes a statement. It is safe to call repeatedly.

columns(statement)

@spec columns(t()) :: [Tursox.Column.t()]

Returns ordered column metadata, including duplicate names.

execute(statement, params \\ [])

@spec execute(t(), term()) :: {:ok, Tursox.Result.t()} | {:error, Tursox.Error.t()}

Executes this prepared statement and returns affected-row metadata.

query(statement, params \\ [])

@spec query(t(), term()) :: {:ok, Tursox.Cursor.t()} | {:error, Tursox.Error.t()}

Starts an incremental native row cursor.

reset(statement)

@spec reset(t()) :: :ok | {:error, Tursox.Error.t()}

Resets a completed statement for explicit reuse.