Class | Sequel::TinyTDS::Dataset
In: | lib/sequel/adapters/tinytds.rb
Parent: | Sequel::Dataset

### Methods

fetch_rows prepare

### Included Modules

Sequel::MSSQL::DatasetMethods

### Classes and Modules

Module Sequel::TinyTDS::Dataset::ArgumentMapper
Module Sequel::TinyTDS::Dataset::PreparedStatementMethods

### Constants

DatasetClass | = | self

### Public Instance methods

fetch_rows(sql) {|h| ...}

Yield hashes with symbol keys, attempting to optimize for various cases.

[Source]

         # File lib/sequel/adapters/tinytds.rb, line 205
    205:       def fetch_rows(sql)
    206:         execute(sql) do |result|
    207:           each_opts = {:cache_rows=>false}
    208:           each_opts[:timezone] = :utc if db.timezone == :utc
    209:           rn = row_number_column if offset = @opts[:offset]
    210:           columns = cols = result.fields.map{|c| output_identifier(c)}
    211:           if offset
    212:             rn = row_number_column
    213:             columns = columns.dup
    214:             columns.delete(rn)
    215:           end
    216:           @columns = columns
    217:           #if identifier_output_method
    218:             each_opts[:as] = :array
    219:             result.each(each_opts) do |r|
    220:               h = {}
    221:               cols.zip(r).each{|k, v| h[k] = v}
    222:               h.delete(rn) if rn
    223:               yield h
    224:             end
    225: ??
    226:         end
    227:         self
    228:       end

prepare(type, name=nil, *values)

Create a named prepared statement that is stored in the database (and connection) for reuse.

[Source]

         # File lib/sequel/adapters/tinytds.rb, line 247
    247:       def prepare(type, name=nil, *values)
    248:         ps = to_prepared_statement(type, values)
    249:         ps.extend(PreparedStatementMethods)
    250:         if name
    251:           ps.prepared_statement_name = name
    252:           db.prepared_statements[name] = ps
    253:         end
    254:         ps
    255:       end

[Validate]