simple sql implementation of notbed-db