Add remaining database code.