MQDB exposes every operation (CRUD, schema, constraints, indexes, catalog, health) through a single db.execute(topic, payload) call. The topic decides which operation runs. This mirrors MQTT's request/response pattern, so the same code works whether you embed MQDB in a browser or talk to it via an MQTT broker.
$DB/users/42/update → update user 42. $DB/_admin/schema/users/set → set users schema.null when none are needed.$DB/{entity}/…), admin ($DB/_admin/…), and lifecycle ($DB/_health).
flowchart LR
T["Topic: $DB/users/42/update"] --> R[Router]
P["Payload: { name: 'Bob' }"] --> R
R --> O1[users/create]
R --> O2[users/42 · read]
R --> O3[users/42/update]
R --> O4[users/42/delete]
R --> O5[users/list]
R --> A1[_admin/schema/users/set]
R --> A2[_admin/constraint/users/add]
R --> A3[_admin/index/users/add]
R --> A4[_admin/catalog]
R --> H[_health]
style R fill:#b2dfdb,stroke:#00695c
style T fill:#e0f2f1,stroke:#00695c
style P fill:#e0f2f1,stroke:#00695c
Health preset. That sets the topic to $DB/_health and payload to null. Click Execute to see { status: "ok", … }.Create product preset. Execute → you get back the new record with its generated id.List products → you see the record you just created.Run all tests. 13 tests run in sequence, exercising the full topic surface (CRUD, schema, constraint, index, catalog, and invalid-topic rejection).productsorders| Topic | What it does |
|---|---|
| $DB/_health | Liveness / readiness check |
| $DB/_admin/catalog | List all known entities |
| $DB/{entity}/create | Create a record (payload = fields) |
| $DB/{entity}/{id} | Read a record |
| $DB/{entity}/{id}/update | Update a record (merge) |
| $DB/{entity}/{id}/delete | Delete a record |
| $DB/{entity}/list | List records (payload = query options) |
| $DB/_admin/schema/{entity}/set | Register / replace schema |
| $DB/_admin/schema/{entity}/get | Fetch the schema |
| $DB/_admin/constraint/{entity}/add | Add unique / not_null / foreign key |
| $DB/_admin/constraint/{entity}/list | List the entity's constraints |
| $DB/_admin/index/{entity}/add | Add a secondary index |
Run all tests exercises the full topic surface in 13 steps and reports pass/fail for each:
ok/create/{id}/{id}/update/list/{id}/delete_admin/schema/…/set_admin/schema/…/get_admin/constraint/…/add_admin/constraint/…/list_admin/index/…/add_admin/catalog