---
title: "POST /v1/sqlite/execute"
method: POST
path: "/v1/sqlite/execute"
tags: ["sqlite"]
---

# POST /v1/sqlite/execute

`POST /v1/sqlite/execute`

Execute a single SQLite statement and return results

## Request body

- object — A single statement to run
  - `statement` union, required
    - string — Simple SQL statement to run in SQLite
    - object — A parameterized SQL query. See https://docs.turso.tech/sdk/ts/reference#batch-transactions for reference
      - `sql` string, required — SQL statement, with ? placeholders for arguments
      - `args` union, required — List of arguments to be used in the given statement
        - unknown[]
          - unknown
        - object

## Response `200`

Result of executing an SQL statement.

- ResultSet — Result of executing an SQL statement.
  - `columns` string[], required — 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` string[], required — 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[], required — Rows produced by the statement.
    - unknown[]
      - unknown
  - `rowsAffected` number, required — Number of rows that were affected by an UPDATE, INSERT or DELETE operation. This value is not specified for other SQL statements.
  - `lastInsertRowid` union — 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.
    - string
    - number

---

[API](https://skmtc.net/val-town/apis/val-town-api.md) · [All operations](https://skmtc.net/val-town/apis/val-town-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/val-town/val-town-api/revisions/4d8b6d2e6db3/schema)
