Class Index [+]

Quicksearch

Sequel::ADO::MSSQL::DatabaseMethods

Constants

ROWS_AFFECTED

Query to use to get the number of rows affected by an update or delete query.

Public Instance Methods

execute_ddl(sql, opts={}) click to toggle source

Just execute so it doesn’t attempt to return the number of rows modified.

    # File lib/sequel/adapters/ado/mssql.rb, line 15
15:         def execute_ddl(sql, opts={})
16:           execute(sql, opts)
17:         end
Also aliased as: execute_insert
execute_dui(sql, opts={}) click to toggle source

Issue a separate query to get the rows modified. ADO appears to use pass by reference with an integer variable, which is obviously not supported directly in ruby, and I’m not aware of a workaround.

    # File lib/sequel/adapters/ado/mssql.rb, line 23
23:         def execute_dui(sql, opts={})
24:           return super unless @opts[:provider]
25:           synchronize(opts[:server]) do |conn|
26:             begin
27:               log_yield(sql){conn.Execute(sql)}
28:               res = log_yield(ROWS_AFFECTED){conn.Execute(ROWS_AFFECTED)}
29:               res.getRows.transpose.each{|r| return r.shift}
30:             rescue ::WIN32OLERuntimeError => e
31:               raise_error(e)
32:             end
33:           end
34:         end
execute_insert(sql, opts={}) click to toggle source
Alias for: execute_ddl

Private Instance Methods

begin_transaction(conn, opts={}) click to toggle source

The ADO adapter’s default provider doesn’t support transactions, since it creates a new native connection for each query. So Sequel only attempts to use transactions if an explicit :provider is given.

    # File lib/sequel/adapters/ado/mssql.rb, line 41
41:         def begin_transaction(conn, opts={})
42:           super if @opts[:provider]
43:         end
commit_transaction(conn, opts={}) click to toggle source
    # File lib/sequel/adapters/ado/mssql.rb, line 45
45:         def commit_transaction(conn, opts={})
46:           super if @opts[:provider]
47:         end
rollback_transaction(conn, opts={}) click to toggle source
    # File lib/sequel/adapters/ado/mssql.rb, line 49
49:         def rollback_transaction(conn, opts={})
50:           super if @opts[:provider]
51:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.