Add Database::transact method