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

dataset(*args)

[Source]

        # File lib/sequel/adapters/dbi.rb, line 29
    29:           def self.dataset(*args)
    30:             ds = super
    31:             ds.extend Sequel::MSSQL::DatasetMethods
    32:             ds
    33:           end

new(opts)

[Source]

        # File lib/sequel/adapters/dbi.rb, line 23
    23:       def initialize(opts)
    24:         super
    25:         case @opts[:db_type]
    26:         when 'mssql'
    27:           Sequel.ts_require 'adapters/shared/mssql'
    28:           extend Sequel::MSSQL::DatabaseMethods
    29:           def self.dataset(*args)
    30:             ds = super
    31:             ds.extend Sequel::MSSQL::DatasetMethods
    32:             ds
    33:           end
    34:         end
    35:       end

### Public Instance methods

connect(server)

[Source]

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

do(sql, opts={})

[Source]

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

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

[Source]

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

execute_dui(sql, opts={})

Alias for do

[Validate]