Val Town · Schema
ResultSet
Result of executing an SQL statement.
Developer ToolsServerlessJavaScriptTypeScriptSocial CodingHTTP EndpointsCron JobsEmailSQLiteBlob Storage
Properties
| Name | Type | Description |
|---|---|---|
| columns | array | Names of columns. Names of columns can be defined using the `AS` keyword in SQL: ```sql SELECT author AS author, COUNT(*) AS count FROM books GROUP BY author ``` |
| columnTypes | array | Types of columns. The types are currently shown for types declared in a SQL table. For column types of function calls, for example, an empty string is returned. |
| rows | array | Rows produced by the statement. |
| rowsAffected | number | Number of rows that were affected by an UPDATE, INSERT or DELETE operation. This value is not specified for other SQL statements. |
| lastInsertRowid | object | ROWID of the last inserted row. This value is not specified if the SQL statement was not an INSERT or if the table was not a ROWID table. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://api.val.town/schemas/resultset",
"title": "ResultSet",
"type": "object",
"required": [
"columns",
"columnTypes",
"rows",
"rowsAffected"
],
"properties": {
"columns": {
"type": "array",
"items": {
"type": "string"
},
"description": "Names of columns.\n\nNames of columns can be defined using the `AS` keyword in SQL:\n\n```sql\nSELECT author AS author, COUNT(*) AS count FROM books GROUP BY author\n```"
},
"columnTypes": {
"type": "array",
"items": {
"type": "string"
},
"description": "Types of columns.\n\nThe types are currently shown for types declared in a SQL table. For column types of function calls, for example, an empty string is returned."
},
"rows": {
"type": "array",
"items": {
"type": "array",
"items": {
"description": "Columns can be accessed like an object by column names."
},
"title": "TursoRow"
},
"description": "Rows produced by the statement."
},
"rowsAffected": {
"type": "number",
"description": "Number of rows that were affected by an UPDATE, INSERT or DELETE operation.\n\nThis value is not specified for other SQL statements."
},
"lastInsertRowid": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "null"
}
],
"description": "ROWID of the last inserted row.\n\nThis value is not specified if the SQL statement was not an INSERT or if the table was not a ROWID table."
}
},
"description": "Result of executing an SQL statement."
}