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 216
    216:       def fetch_rows(sql)
    217:         execute(sql) do |result|
    218:           each_opts = {:cache_rows=>false}
    219:           each_opts[:timezone] = :utc if db.timezone == :utc
    220:           rn = row_number_column if offset = @opts[:offset]
    221:           columns = cols = result.fields.map{|c| output_identifier(c)}
    222:           if offset
    223:             rn = row_number_column
    224:             columns = columns.dup
    225:             columns.delete(rn)
    226:           end
    227:           @columns = columns
    228:           #if identifier_output_method
    229:             each_opts[:as] = :array
    230:             result.each(each_opts) do |r|
    231:               h = {}
    232:               cols.zip(r).each{|k, v| h[k] = v}
    233:               h.delete(rn) if rn
    234:               yield h
    235:             end
    236: ??
    237:         end
    238:         self
    239:       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 258
    258:       def prepare(type, name=nil, *values)
    259:         ps = to_prepared_statement(type, values)
    260:         ps.extend(PreparedStatementMethods)
    261:         if name
    262:           ps.prepared_statement_name = name
    263:           db.set_prepared_statement(name, ps)
    264:         end
    265:         ps
    266:       end

[Validate]