Finished db.clj implementation