lib/arcade/database.rb
# execute a command  which modifies the database
#
# The operation is performed via Transaction/Commit
# If an Error occurs, its rolled back
#
execute a command  which modifies the database
The operation is performed via Transaction/Commit
If an Error occurs, its rolled back
execute a command which modifies the database The operation is performed via Transaction / Commit If an Error occurs its rolled back
def execute   &block
      response = Api.execute database, &block
      r= if  response.is_a? Hash
           _allocate_model res
         else
           response
         end
     r 
    rescue  Dry::Struct::Error => e
      logger.error "Execution  FAILED --> #{e.exception}"
      []  
    end
def execute & block response = Api . execute database , & block r = if response . is_a? Hash _allocate_model res else response end r rescue Dry :: Struct :: Error => e logger . error "Execution  FAILED --> #{e.exception}" [ ] end
execute a command  which modifies the database
The operation is performed via Transaction/Commit
If an Error occurs, its rolled back
execute a command which modifies the database The operation is performed via Transaction / Commit If an Error occurs its rolled back
#  Api.begin_transaction database # puts response.inspect  # debugging #         elsif response.is_a? Array # remove empty results #           response.delete_if{|y| y.empty?} # response.map do | res | #   if res.key? :"@rid" #     allocate_model res #   else #     res #   end # end #  Api.commit database # return associated array of Arcade::Base-objects #   Api.rollback database #  return empty result
block