Add support for writing attributes to DB