HTTP client for the SpacetimeDB REST API (v1).
All functions take host (e.g. "localhost:3000") as the first argument
and return {:ok, result} | {:error, reason} tuples. Authentication is
handled via explicit token parameters — no global state.
Uses Req for HTTP, consistent with Spacetimedbex.Schema.fetch/2.
Summary
Functions
Add a name to a database.
Call a reducer on a database.
Create a new identity and token.
Delete a database.
Get database metadata.
Get database identity hex string.
List all names for a database.
List databases owned by identity.
Get the public key for verifying tokens (PEM format).
Get a short-lived websocket token.
Fetch database logs.
Ping the server. Returns :ok on success.
Publish a WASM module to a database.
Fetch database schema. Delegates to Spacetimedbex.Schema.fetch/2.
Replace the full name list for a database.
Execute one or more SQL queries against a database.
Verify that token belongs to identity. Returns :ok on 204.
Functions
Add a name to a database.
Call a reducer on a database.
Create a new identity and token.
Delete a database.
Get database metadata.
Get database identity hex string.
List all names for a database.
List databases owned by identity.
Get the public key for verifying tokens (PEM format).
Get a short-lived websocket token.
Fetch database logs.
Options:
:num_lines- number of log lines (integer):follow- stream logs (boolean, not yet supported — returns single response)
Ping the server. Returns :ok on success.
Publish a WASM module to a database.
Options:
:clear- clear existing data on update (boolean)
Fetch database schema. Delegates to Spacetimedbex.Schema.fetch/2.
Replace the full name list for a database.
Execute one or more SQL queries against a database.
Returns {:ok, results} where results is a list of
%{schema: schema, rows: rows} maps, one per statement.
Verify that token belongs to identity. Returns :ok on 204.