Add support for exporting to database