Methods

Class/Module Index [+]

Quicksearch

Sequel::DataObjects::Postgres::AdapterMethods

Methods to add to the DataObjects adapter/connection to allow it to work with the shared PostgreSQL code.

Public Instance Methods

execute(sql, args=nil) click to toggle source

Give the DataObjects adapter a direct execute method, which creates a statement with the given sql and executes it.

# File lib/sequel/adapters/do/postgres.rb, line 17
def execute(sql, args=nil)
  command = create_command(sql)
  begin
    if block_given?
      begin
        yield(reader = @db.log_yield(sql){command.execute_reader})
      ensure
        reader.close if reader
      end
    else
      @db.log_yield(sql){command.execute_non_query}
    end
  rescue ::DataObjects::Error => e
    raise_error(e)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.