SQLiteQuery

Inherits: RefCounted < Object

Class for executing SQL queries on an SQLite database.

Description

A class that allows you to execute SQL queries on an SQLite database. It provides methods for both single and batch execution of queries. It also provides a method to retrieve the column names from the last executed query and a method to get the last error message, if any.

Properties

Variant

arguments

null

String

query

""

Methods

Array[SQLiteQueryResult]

batch_execute(rows: Array)

SQLiteQueryResult

execute(arguments: Variant = null)

void

finalize_query()

Array[SQLiteColumnSchema]

get_columns()

String

get_last_error_message() const

int

get_stmt_status(op: int, reset: bool = false)

bool

is_ready() const


Property Descriptions

Variant arguments = null 🔗

Arguments for the query.


String query = "" 🔗

The query executed.


Method Descriptions

Array[SQLiteQueryResult] batch_execute(rows: Array) 🔗

Executes a batch of SQL queries. The queries are provided as an array of strings. Returns the result of the last query in the batch.


SQLiteQueryResult execute(arguments: Variant = null) 🔗

Executes a single SQL query. The query is provided as a string. If the query requires arguments, they can be provided as an array. Returns the result of the query.


void finalize_query() 🔗

Finalizes and cleans up the prepared query statement.


Array[SQLiteColumnSchema] get_columns() 🔗

Returns an array of column names from the last executed query.


String get_last_error_message() const 🔗

Returns the last error message, if any. If there was no error, returns an empty string.


int get_stmt_status(op: int, reset: bool = false) 🔗

Returns the current value of a statement status counter identified by op.

These counters track how many times specific operations were performed by the prepared statement and can be used to analyze its performance characteristics.

If reset is true, the selected counter is reset to zero after its value is retrieved. Otherwise, the counter value is left unchanged.


bool is_ready() const 🔗

Returns true if the statement is prepared.