Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

CSV Example

What This Teaches

Use this when product, customer, or spreadsheet-like data starts as CSV. db scans the header row, infers field shapes, generates types, and mirrors the rows into JSON runtime state.

Files To Inspect

Run It

From the repository root, use the repo-internal CLI path:

npm run db -- sync --cwd ./examples/csv
npm run db -- serve --cwd ./examples/csv

Open the viewer:

http://127.0.0.1:7331/__db

Expected Result

sync writes .db/state/customers.json. When db/customers.csv changes, the source hash changes and the JSON store refreshes from CSV.

REST Request To Try

Leave serve running and run this from another terminal:

curl 'http://127.0.0.1:7331/db/customers.json?select=id,name,email'

Features To Notice

Cleanup

Generated .db/ output is ignored by git and can be removed whenever you want fresh runtime state.

More Docs