add create-db-fn  and compare-and-swap fn