lib: replace use of static_cast for writable databases