Add database insertion functionality