In the persistency library, db_attach/2 has these options:
close(close journal after write),
flush(default, flush journal after write) or
none(handle as fully buffered stream).
close: I am assuming a “write” is an assert/1 or retract_all/1 statement?
none: What does “fully buffered stream” mean? I was assuming this meant all changes would be fully buffered and written only on db_detach/0 but my tests show that the file is updated after a query is run, and the docs for db_detach/0 say that the “the file is not affected”. When does the stream get flushed? Between queries?
Finally, if my single-threaded, single process code is the only one doing the persistency, I’ll never need the db_sync/1 call, right? Or do I need to call it periodically for gc of the journal?