Database
These notes are rows in a real SQLite database. kreft dev --db sqlite:demo/database/demo.db turns its tables into an API: /api/notes.
0 notes
Network error: RequestInit: Expected signal ("AbortSignal {}") to be an instance of AbortSignal.
No notes.
How it works
-- demo/database/migrations/001_create_notes.sql (runs once, by itself)
CREATE TABLE notes (id INTEGER PRIMARY KEY, title VARCHAR(120) NOT NULL, …);
// in this page
const notes = table('notes')
load list = notes.all({ q: search, _sort: '-id' })
await notes.create(values) // POST /api/notes
await notes.patch(id, changes) // PATCH /api/notes/1
await notes.remove(id) // DELETE /api/notes/1
The same works with MySQL (--db mysql://…) and PostgreSQL (--db postgres://…). A title is required and must be unique: try saving one twice.