Constant growth of the base

:- persistent
   app_info(key:atom, value:any).

:- setting(database, callable, 'app_info.db',
I noticed that the database file has grown, although I delete and write and expect that there will be only one line, but I see the entire history of changes
`   forall(member(Key = Value, Data),
               corresponding(Key, CKey),
               config:retractall_app_info(CKey, _),
               config:assert_app_info(CKey, Value)

What am I doing wrong?

The persistency library aims at reliable storage with few updates. You can call db_sync/1 as db_sync(gc) to get rid of (too many) retract lines. Using db_sync(gc(always)) it rewrites a clean DB without checking the amount of garbage first.

how to do this, I typed db_sync(gc) in the console, but the file did not decrease in size.

That should work, unless the amount of garbage is too low or the db is associated to another module. Note that all the predicates are meta predicates and must thus be called in the same module context.

If not, trace though it and see why not :slight_smile: