QueryResult
The data returned by the query
Introduction
The data returned by the useQuery function is an instance of QueryResult
, which contains the results of the query along with some additional information.
Properties
The number of rows returned by the query.
An array of Field
objects, each one representing a column in the query result. Each Field
object has the following properties:
name
: The name of the column.type
: The type of the column data.
The type
property can be one of the following values: string
, integer
, float
, boolean
, datetime
, null
, unknown
.
An array of rows returned by the query. Each row is represented by an array of values, where each element in the array corresponds to a field in the query result.
Methods
If you need to export the data into different formats, you can use the following methods:
.serialize()
Serializes the query result into a JavaScript object.
.toJSON()
Serializes the query result into a JSON string.
.toCSV()
Serializes the query result into a CSV string.
.toArray()
Serializes the query result into an array of objects, where each object represents a row in the query result.