On this page, you will find more information about the libSQL Result and available functions.
The LibSQLResult
class represents the result set of a LibSQL query. It provides methods for retrieving query results and metadata about the result set.
fetchArray
Fetches the result set as an array or an iterator.
LibSQL::LIBSQL_BOTH
(optional): The fetching mode. Defaults to LibSQL::LIBSQL_BOTH
(both associative and numerical arrays).
LibSQL::LIBSQL_ASSOC
: Return an associative array.LibSQL::LIBSQL_NUM
: Return a numerical array.LibSQL::LIBSQL_BOTH
: Return both associative and numerical arrays.LibSQL::LIBSQL_ALL
: Return all results.LibSQL::LIBSQL_LAZY
: Return a generator for lazy-loading results.array|LibSQLIterator
- The fetched result setRead more detail about LibSQLIterator Class
finalize
Finalizes the result set and frees the associated resources.
reset
Resets the result set for re-execution. This can be used to iterate over the same results multiple times.
void
columnName
Retrieves the name of a column by its index.
int $column
: The index of the column (zero-based).A string
containing the name of the specified column.
columnType
Retrieves the type of a column by its index.
int $column
: The index of the column (zero-based).A string
containing the data type of the specified column.
numColumns
Retrieves the number of columns in the result set.
An int
representing the total number of columns in the result set.