Console
Products
Markdown

Databases

Single-writer SQLite (sql) and JSON document (documents) databases with durable S3 commit logs and 30 days of point-in-time history.

Skopik Platform Databases run on the Shared Objects engine. Each database is named within an organization (one shared namespace) and has a fixed type chosen at creation:

  • sql — A dedicated SQLite database with a single writer, foreign keys enabled, parameterized queries, and transactional batches.
  • documents — JSON documents with IDs, queryable by any field using JSON filters — no SQL required.

Every committed write is shipped to S3 Express One Zone before it is acknowledged and copied to S3 Standard within a second. Idle databases unload automatically and reload on any host on the next call.

#Creating a Database

bash
skopik create_database --name notes --type sql
skopik create_database --name tasks --type documents

#Working with sql Databases

Three operations are supported: execute (one statement in a transaction), batch (multiple statements in one atomic transaction), and query (read-only statement).

bash
skopik execute_sql --name notes \
  --sql "CREATE TABLE IF NOT EXISTS items (id INTEGER PRIMARY KEY, title TEXT NOT NULL)"

skopik execute_sql --name notes \
  --sql "INSERT INTO items (title) VALUES (?)" \
  --params '["Ship docs"]'

skopik query_sql --name notes --sql "SELECT id, title FROM items"

Limits: 30 seconds per call, 16 MiB max request/response body, 1 GiB max database size. ATTACH, VACUUM, temp tables, and manual BEGIN/COMMIT are disallowed (use batch for multi-statement transactions).

#Working with documents Databases

Store JSON objects by ID or let the platform generate one, bulk-insert, and filter by any field:

  • POST /v1/databases/{name}/documents — Insert a document (MCP put_document).
  • PUT / GET / DELETE /v1/databases/{name}/documents/{id} — Replace, fetch, or delete by ID.
  • POST /v1/databases/{name}/documents/bulk — Put multiple documents in one call (MCP put_documents).
  • POST /v1/databases/{name}/documents/query — Filter, sort, and paginate documents (MCP query_documents).

#30-Day History, Rewind & Time Travel

Because the S3 page log is the source of truth, both sql and documents databases support full history operations for the last 30 days:

CapabilityRouteMCP Tool
Inspect a momentPOST /v1/databases/{name}/momentget_database_moment
Query a past momentPOST /v1/databases/{name}/moment/query (or .../moment/documents/query)query_sql_moment, query_documents_moment
Rewind in placePOST /v1/databases/{name}/rewindrewind_database
Undo last rewindPOST /v1/databases/{name}/undo-rewindundo_database_rewind
Copy a moment to a new DBPOST /v1/databases/{name}/copycopy_database
Compare two momentsPOST /v1/databases/{name}/comparecompare_database
Commit log & activityGET /v1/databases/{name}/log, .../activitylist_database_log, get_database_activity
Download SQLite file`GET /v1/databases/{name}/download[?at=\seq=]`(HTTP only)