Annotai.Persistence.Adapter.File (Annotai v0.1.0)

Copy Markdown View Source

Default persistence adapter: an ETF snapshot of the whole annotation set.

The list is encoded with :erlang.term_to_binary/1 and written atomically (temp file + rename) so a crash mid-write can't leave a torn snapshot.

Loading is total: a missing, unreadable, or corrupt file simply loads as an empty set — this is a throwaway dev cache, so on any problem we start fresh and let the next write replace it. Encoding the whole set on each save keeps the adapter trivial, fine for dev-scale counts.

Reads :path from the config map.