Functionality to insert keys into the database