Add support for reading/writing from/to database