type
Statement
Statement is an executable statement for a specific database. A statement may be executed immediately or prepared and executed later with parameters. See pod-doc.
fields
limit |
Maximum number of rows returned when this statement is executed. |
---|---|
sql |
The SQL text used to create this statement. |
methods
close |
Close the statement. |
---|---|
execute |
Execute a SQL statement and if applicable return a result |
prepare |
Prepare this statement by compiling for efficient execution. |
query |
Execute the statement and return the resulting |
queryEach |
Execute the statement. |
queryEachWhile |
Execute the statement. |
Slot Details
close
execute
src
Obj execute([Str:Obj]? params := null)
Execute a SQL statement and if applicable return a result:
- If the statement is a query or procedure which produces a result set, then return
Row[]
- If the statement is an insert and auto-generated keys are supported by the connector then return
Int[]
orStr[]
of keys generated - Return an
Int
with the update count
limit
prepare
query
queryEach
queryEachWhile
src
Obj? queryEachWhile([Str:Obj]? params, |Row->Obj?| eachFunc)
Execute the statement. For each row in the result, invoke the specified function eachFunc
. If the function returns non-null, then break the iteration and return the resulting object. Return null if the function returns null for every item.