Added db function for inserting posts