Class: Sequel::DBI::Database

Class | Sequel::DBI::Database
In: | lib/sequel_core/adapters/dbi.rb
Parent: | Sequel::Database

### Methods

connect dataset do execute execute_dui

### Constants

DBI_ADAPTERS | = | { :ado => "ADO", :db2 => "DB2", :frontbase => "FrontBase", :interbase => "InterBase", :msql => "Msql", :mysql => "Mysql", :odbc => "ODBC", :oracle => "Oracle", :pg => "pg", :proxy => "Proxy", :sqlite => "SQLite", :sqlrelay => "SQLRelay"

### Public Instance methods

connect(server)

[Source]

        # File lib/sequel_core/adapters/dbi.rb, line 42
    42:       def connect(server)
    43:         opts = server_opts(server)
    44:         dbname = opts[:database]
    45:         if dbname !~ /^DBI:/ then
    46:           dbname = "DBI:#{dbname}"
    47:           [:host, :port].each{|sym| dbname += ";#{sym}=#{opts[sym]}" unless opts[sym].blank?}
    48:         end
    49:         ::DBI.connect(dbname, opts[:user], opts[:password])
    50:       end

dataset(opts = nil)

[Source]

        # File lib/sequel_core/adapters/dbi.rb, line 52
    52:       def dataset(opts = nil)
    53:         DBI::Dataset.new(self, opts)
    54:       end

do(sql, opts={})

[Source]

        # File lib/sequel_core/adapters/dbi.rb, line 65
    65:       def do(sql, opts={})
    66:         log_info(sql)
    67:         synchronize(opts[:server]){|conn| conn.do(sql)}
    68:       end

execute(sql, opts={}) {|r| ...}

[Source]

        # File lib/sequel_core/adapters/dbi.rb, line 56
    56:       def execute(sql, opts={})
    57:         log_info(sql)
    58:         synchronize(opts[:server]) do |conn|
    59:           r = conn.execute(sql)
    60:           yield(r) if block_given?
    61:           r
    62:         end
    63:       end

execute_dui(sql, opts={})

Alias for do

[Validate]