Database query
An action block that queries content stored in a SQLite database file.
The fiber will pause until the statement has been executed.
This block will open the database file in read-only mode and should therefore not execute a
statement (e.g. DELETE
, INSERT
or UPDATE
) that may modify the stored data,
use the Database modify block for that.
Binary (BLOB) columns are not supported and will be exclude from the result.
To conserve memory a maximum of 500 rows will be included in the result,
append LIMIT 500
to the statement to ensure it’s not exceeded.
Result types
- Rows as arrays — an array of rows where each row element is an array with column values.
- Rows as dictionaries — an array of rows where each row element is a dictionary with column names as keys and the value thereof.
- Concatenated rows — a single “flat” array with all column values of all rows concatenated.
Input arguments
- Database file — path to an existing database file.
- Statement — a SQL statement, default is to just open the database file.
- Parameters — an array of values to replace any
?
within the Statement.
- Result type — type of result assigned to Result see result types, default is Rows as arrays.
Output variables
- Result — variable to assign an array with the query result, structured as Result type.