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

### Methods

connect dataset do execute execute_dui new

### 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 Class methods

new(opts)

[Source]

        # File lib/sequel/adapters/dbi.rb, line 23
    23:       def initialize(opts)
    24:         super(opts)
    25:         case opts[:db_type]
    26:         when 'mssql'
    27:           Sequel.require 'adapters/shared/mssql'
    28:           extend Sequel::MSSQL::DatabaseMethods
    29:         end
    30:       end

### Public Instance methods

connect(server)

[Source]

        # File lib/sequel/adapters/dbi.rb, line 51
    51:       def connect(server)
    52:         opts = server_opts(server)
    53:         dbname = opts[:database]
    54:         if dbname !~ /^DBI:/ then
    55:           dbname = "DBI:#{dbname}"
    56:           [:host, :port].each{|sym| dbname += ";#{sym}=#{opts[sym]}" unless blank_object?(opts[sym])}
    57:         end
    58:         ::DBI.connect(dbname, opts[:user], opts[:password])
    59:       end

dataset(opts = nil)

[Source]

        # File lib/sequel/adapters/dbi.rb, line 61
    61:       def dataset(opts = nil)
    62:         DBI::Dataset.new(self, opts)
    63:       end

do(sql, opts={})

[Source]

        # File lib/sequel/adapters/dbi.rb, line 74
    74:       def do(sql, opts={})
    75:         log_info(sql)
    76:         synchronize(opts[:server]){|conn| conn.do(sql)}
    77:       end

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

[Source]

        # File lib/sequel/adapters/dbi.rb, line 65
    65:       def execute(sql, opts={})
    66:         log_info(sql)
    67:         synchronize(opts[:server]) do |conn|
    68:           r = conn.execute(sql)
    69:           yield(r) if block_given?
    70:           r
    71:         end
    72:       end

execute_dui(sql, opts={})

Alias for do

[Validate]