Infrastructure added for inserting into database

doesn't work. I blame Andrew.