Pass function name to insert() in replace() in Database class

Change-Id: I891370aa5d623ac9971c719da7996a93db641a2c