First pass at db interface.