API reference
GDSQLiteStatement
A SQLite statement prepared once and reused.
Methods
run(params: Array = []) -> Dictionary, Errrun_many(rows: Array) -> Dictionary, Errone(params: Array = []) -> Variant, Errall(params: Array = []) -> Array, Errclose() -> voidis_valid() -> bool
run
run(params: Array = []) -> Dictionary, ErrExecute a write statement and return affected rows.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
params | Array | [] | Parameter values to bind to a prepared SQL statement. |
Return value
Dictionary, Err
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
run_many
run_many(rows: Array) -> Dictionary, ErrExecute a write statement for multiple argument sets.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
rows | Array | Required | Rows in input order. Batch database calls use one parameter set per row. |
Return value
Dictionary, Err
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
one
one(params: Array = []) -> Variant, ErrReturn the first read-only query row.
Return the first row and Err. An empty result returns Err.NOT_FOUND.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
params | Array | [] | Parameter values to bind to a prepared SQL statement. |
Return value
Variant, Err
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
all
all(params: Array = []) -> Array, ErrReturn all read-only query rows.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
params | Array | [] | Parameter values to bind to a prepared SQL statement. |
Return value
Array, Err
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
close
close() -> voidRelease the prepared statement explicitly.
Parameters
No parameters.
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
is_valid
is_valid() -> boolCheck whether both statement and connection are usable.
Parameters
No parameters.
Return value
bool
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.