Class: Sequel::ADO::Database

Class | Sequel::ADO::Database
In: | lib/sequel_core/adapters/ado.rb
Parent: | Sequel::Database

### Methods

connect dataset do execute new

### Public Class methods

new(opts)

[Source]

        # File lib/sequel_core/adapters/ado.rb, line 17
    17:       def initialize(opts)
    18:         super(opts)
    19:         opts[:driver] ||= 'SQL Server'
    20:         case opts[:driver]
    21:         when 'SQL Server'
    22:           require 'sequel_core/adapters/shared/mssql'
    23:           extend Sequel::MSSQL::DatabaseMethods
    24:         end
    25:       end

### Public Instance methods

connect(server)

[Source]

        # File lib/sequel_core/adapters/ado.rb, line 27
    27:       def connect(server)
    28:         opts = server_opts(server)
    29:         s = "driver=#{opts[:driver]};server=#{opts[:host]};database=#{opts[:database]}#{";uid=#{opts[:user]};pwd=#{opts[:password]}" if opts[:user]}"
    30:         handle = WIN32OLE.new('ADODB.Connection')
    31:         handle.Open(s)
    32:         handle
    33:       end

dataset(opts = nil)

[Source]

        # File lib/sequel_core/adapters/ado.rb, line 35
    35:       def dataset(opts = nil)
    36:         ADO::Dataset.new(self, opts)
    37:       end

do(sql, opts={})

Alias for execute

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

[Source]

        # File lib/sequel_core/adapters/ado.rb, line 39
    39:       def execute(sql, opts={})
    40:         log_info(sql)
    41:         synchronize(opts[:server]) do |conn|
    42:           r = conn.Execute(sql)
    43:           yield(r) if block_given?
    44:           r
    45:         end
    46:       end

[Validate]