Add a database class
Database code