Skip to content

The SQLite API exposes SQL operations against local SQLite databases. Use these endpoints to fetch the OpenAPI specification, run shareable ad-hoc queries via base64-encoded SQL, execute multi-statement transactions with ACID guarantees, and create new databases with optional KV store initialization.

Retrieve the OpenAPI specification for the SQLite service.

Redirects to the YAML specification endpoint.

This endpoint takes no parameters.

Terminal window
curl -L https://api.hoody.com/api/v1/sqlite/openapi.json

Retrieve the complete OpenAPI specification for the SQLite service in YAML format.

This endpoint takes no parameters.

Terminal window
curl https://api.hoody.com/api/v1/sqlite/openapi.yaml

Execute a SQL query using base64-encoded SQL for easy sharing via URL. Both the db and sql query parameters are required.

NameInTypeRequiredDescription
dbquerystringYesDatabase file path
sqlquerystringYesBase64-encoded SQL query
Terminal window
curl "https://api.hoody.com/api/v1/sqlite/query?db=my-database.db&sql=U0VMRUNUICogRlJPTSB1c2Vycw=="

Execute multiple SQL queries or statements in a single transaction with full ACID guarantees. The db query parameter identifies the database; set create_db_if_missing=true to create the file when it does not yet exist. The request body supplies the transaction payload.

NameInTypeRequiredDescription
dbquerystringYesDatabase path (absolute path, bare name, or ./name shorthand resolved to /hoody/databases/*.db)
create_db_if_missingquerybooleanNoCreate database file if it is missing. Default: false

The request body is a transaction request. Each transaction item accepts statement (preferred) or sql alias for the SQL statement.

Top-level fields:

FieldTypeRequiredDescription
resultFormatstringNoFormat for results (e.g. "json")
transactionarrayNoArray of transaction items executed atomically

Each item in transaction:

FieldTypeRequiredDescription
statementstringNoSQL statement to execute (preferred field)
sqlstringNoAlias for statement (backward compatibility)
querystringNoSQL query
valuesarrayNoParameter values bound to the statement
valuesBatcharrayNoBatch of parameter value rows for bulk inserts
noFailbooleanNoIf true, do not fail the transaction when this statement fails
Terminal window
curl -X POST "https://api.hoody.com/api/v1/sqlite/db?db=my-database.db&create_db_if_missing=true" \
-H "Content-Type: application/json" \
-d '{
"resultFormat": "json",
"transaction": [
{ "statement": "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)", "noFail": true },
{ "statement": "INSERT INTO users (name, email) VALUES (?, ?)", "values": ["Ada", "ada@example.com"] }
]
}'

Create a new empty SQLite database at the supplied path. Optionally initialize KV store tables at creation time.

NameInTypeRequiredDescription
pathquerystringYesDatabase path (absolute path, bare name, or ./name shorthand resolved to /hoody/databases/*.db)
init_kvquerybooleanNoInitialize KV store tables. Default: false
kv_tablequerystringNoCustom KV table name. Default: "kv_store"
Terminal window
curl -X POST "https://api.hoody.com/api/v1/sqlite/db/create?path=my-database.db&init_kv=true&kv_table=kv_store"