furhter merge db_append and db_insert