added basic db functionality (not compilable)