implement database interface