Every entity supports create, read, update, delete. IDs are auto-generated as incrementing strings unless you pass one in. Updates are merge semantics — omitted fields keep their previous values and _version increments.
db.create(entity, data) → returns the new record with id and _version: 1. Provide id in the payload if you want a specific one; otherwise MQDB assigns the next integer.db.read(entity, id) → returns the record or throws not found.db.update(entity, id, patch) → merges patch into the stored record, bumps _version, returns the new record.db.delete(entity, id) → removes the record. A later read on that id throws.
flowchart LR
C["create({ name, email })"] --> R1["{ id: '1', name, email, _version: 1 }"]
R1 --> U["update(id, { name: 'Bob' })"] --> R2["{ id: '1', name: 'Bob', email, _version: 2 }"]
R2 --> D["delete(id)"] --> X[gone]
R1 --> Q["read(id)"] --> R1
X --> Q2["read(id)"] --> E[throws: not found]
style R1 fill:#e8f5e9,stroke:#2e7d32
style R2 fill:#fff3e0,stroke:#ef6c00
style X fill:#ffcdd2,stroke:#c62828
style E fill:#ffcdd2,stroke:#c62828
Create. A new user is inserted with the default JSON body; the form autofills the new id.age in the data box to 35 and click Update. The record's _version bumps to 2 and the record table shows the new value — email was untouched (merge semantics).Delete. Row removed. Click Read → you see an error.Seed 5 users in Quick actions, then switch entity to posts and Seed 5 posts. Use Clear current entity to wipe and start over.One click drops 5 records into the selected entity.
| ID | Data | Actions |
|---|
Run all tests runs the CRUD lifecycle end-to-end in 6 steps:
idname → new name, original email preserved (merge)not found