Quick Start
-
Lay out your data. Each entry directly under the root becomes a table:
notes/├── tasks/ # directory → one record per file, key = path (subfolders too)│ ├── buy-milk.yaml│ └── write-blog.yaml└── people.yaml # file → a list of records, key = `id`tasks/buy-milk.yaml title: 牛乳を買うdone: falsepriority: 2tags: [errand, home]people.yaml - id: 1name: Aliceteam: platform # lead- id: 2name: Bobteam: sales -
Create the schema.
yamlite initinfers tables and column types from your files (or an existing database), plus keys, expanded lists and references where the data makes them clear, and writesnotes/yamlite.yaml. Review it and commit it with your data.Terminal window yamlite init notes -
Preview, then sync.
Terminal window yamlite status notes # shows what would change, writes nothingyamlite sync notes -
Query and edit with SQL. The database lives at
notes/.yamlite/db.sqlite.Terminal window sqlite3 notes/.yamlite/db.sqlite "select team, count(*) from people group by team"Or use
yamlite queryto run SQL directly without needingsqlite3:Terminal window yamlite query "select team, count(*) from people group by team" notesWrites go the other way too — only the changed field is rewritten, and comments stay:
tasks/buy-milk.yaml $ sqlite3 notes/.yamlite/db.sqlite "update tasks set done = 1 where id = 'buy-milk'"$ yamlite sync notes > /dev/null && cat notes/tasks/buy-milk.yamltitle: 牛乳を買うdone: truepriority: 2tags: [errand, home] -
Keep them in sync while you work.
Terminal window $ yamlite watch notesYAMLite · watching people, tasks in ~/notes · Ctrl-C to stop12:03:41 tasks → db buy-milk12:03:55 people → file 212:04:02 tasks − file renew-passport -
Ignore the cache. Add
.yamlite/to your.gitignore— the YAML files andyamlite.yamlare what you commit.