Base db code prototype