dynamic insert and update db methods