Ndb

The Plan9 network database. However, also suitable as a general purpose database to store random data.

The structure is a simple equals pair, with quotes for spacing if needed.

Example: coffees.db
coffeeId=1
	name="Kiangoi AA"
	region="Embu county"
	country=Kenya
	roaster="Rosetta Roastery"
	notes="bold, hibiscus, blackcurrant, molasses"
	openedAt="2025-12-01"
coffeeId=2
	name=Karumandi
	country=Kenya
	region=
	roaster="Quo Roastery"
	producer="Baragawi Farmers Coop"
	notes="Nutty, grilled lemon, black currants, forest fruit jam"
	openedAt="2026-01-18"
        

Querying

Basic querying can be done with ndbquery -f, where the first argument is a file.

If the database file contains a row with an empty column called database, each file listed under that row will also be queryable.

Example: coffee-index.db
database=
	file=./coffees.db
	file=./brew-log.db
        

In this case, querying coffee-index.db gives you access to the content in both files. If the files contain a shared id, it will return all rows from both files.