Skip to content
  • Auto
  • Light
  • Dark
Get Started

Execute

Execute
post/v1/sqlite/execute

Execute a single SQLite statement and return results

Body Parameters
statementunion
string OR object

Simple SQL statement to run in SQLite

Hide ParametersShow Parameters
UnionMember0string

Simple SQL statement to run in SQLite

ParameterizedQueryobject

A parameterized SQL query. See https://docs.turso.tech/sdk/ts/reference#batch-transactions for reference

Hide ParametersShow Parameters
argsunion
array of unknown OR map[unknown]

List of arguments to be used in the given statement

Hide ParametersShow Parameters
UnionMember0array of unknown
UnionMember1map
sqlstring

SQL statement, with ? placeholders for arguments

Returns
columnsarray of stringcolumnTypesarray of stringrowsarray of array of unknownrowsAffectednumberlastInsertRowidunionResultSet
curl https://api.val.town/v1/sqlite/execute \
    -H 'Content-Type: application/json' \
    -d '{
      "statement": "SELECT 1;"
    }'
200 Example
{
  "columns": [
    "string"
  ],
  "columnTypes": [
    "string"
  ],
  "rows": [
    [
      {}
    ]
  ],
  "rowsAffected": 0,
  "lastInsertRowid": "string"
}