SeleBase
SeleBase quickstart
Overview · SQL console · Limits · Migrations · Errors · Examples
SeleBase gives each project its own SQL database with an HTTP API and a SQL console. Your data lives in your own database; other customers cannot reach it.
1. Get an API key
Keys start with ssk_ and are shown once. Each key belongs to one tenant and has a role: read (SELECT only), migrate (also INSERT, UPDATE, DELETE and schema changes) or admin (also create and delete databases, read the audit log).
2. Create a database
shell
curl -X POST https://<host>/v1/databases \
-H "Authorization: Bearer $SELEBASE_KEY" -H "content-type: application/json" \
-d '{"name":"main"}'
Names are 3 to 32 characters: lowercase letters, digits, _ and -, starting with a letter.
3. Run SQL
shell
curl -X POST https://<host>/v1/databases/main/query \
-H "Authorization: Bearer $SELEBASE_KEY" -H "content-type: application/json" \
-d '{"sql":"CREATE TABLE notes (id INTEGER PRIMARY KEY, body TEXT)"}'
curl -X POST https://<host>/v1/databases/main/query ... \
-d '{"sql":"INSERT INTO notes (body) VALUES (?)","params":["hello"]}'
The response is {"rows":[...],"rowCount":1,"truncated":false,"rowsRead":0,"rowsWritten":1}. Send one statement per request; use params for values.
API summary
| Call | Role |
|---|---|
GET /v1/databases | any |
POST /v1/databases {name} | admin |
DELETE /v1/databases/:name | admin |
POST /v1/databases/:name/query {sql, params} | read (SELECT) / migrate |
GET /v1/databases/:name/schema | any |
GET /v1/databases/:name/export (SQL dump) | any |
POST /v1/databases/:name/import (SQL text) | migrate |
GET /v1/databases/:name/audit | admin |