Add database configuration and connection factory