some basic classes for interacting with a database