Skip to content
  • Auto
  • Light
  • Dark
Get Started

Batch

Batch
post/v1/sqlite/batch

Execute a batch of SQLite statements and return results for all of them

Body Parameters
statementsarray of union
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

modeenum
optional
"write" OR "read" OR "deferred"
Hide ParametersShow Parameters
"write"
"read"
"deferred"
curl https://api.val.town/v1/sqlite/batch \
    -H 'Content-Type: application/json' \
    -d '{
      "statements": [
        "SELECT 1;"
      ]
    }'
200 Example
[
  {
    "columns": [
      "string"
    ],
    "columnTypes": [
      "string"
    ],
    "rows": [
      [
        {}
      ]
    ],
    "rowsAffected": 0,
    "lastInsertRowid": "string"
  }
]