Hey Y'all,
I've been playing around with the
GNU DBM key/value pair database.
You can find some examples on how to do it under the
FPC source on the
packages/gdbm/examples folder.
As a disclaimer I haven't compiled nor ran those examples.
Nonetheless, I did copy the code, almost verbatim to my
TestGNUDBM playground project.
The issue is that on the line that retrieves the last of the keys with
gdbm_nextkey() it throws and
Access Violation exception.
try
key:= gdbm_nextkey(FDB, key);
except
on E: Exception do
begin
memLog.Append(Format('ERROR: %s', [E.Message]));
memLog.Append('Need to report this error triggered on the last entry');
key:= '';
end;
end;
In debug, if you continue running the program it then issues another exception with the following text -ish:
### Not supported on GDB < 5.3 ###
Can the experts please tell me if this is a
known issue so I don't duplicate an issue posting?
At the moment I'm gobbling up the exception so my code doesn't completely break, as you can see on the GitHub repo source code.
I would like not to have to do it. Even if traversing the whole database is not the most common way to use a key/value pair store.
Cheers,
Gus