transform gamble cart to db