Yield hashes with symbol keys, attempting to optimize for various cases.
# File lib/sequel/adapters/tinytds.rb, line 216 def fetch_rows(sql) execute(sql) do |result| each_opts = {:cache_rows=>false} each_opts[:timezone] = :utc if db.timezone == :utc rn = row_number_column if offset = @opts[:offset] columns = cols = result.fields.map{|c| output_identifier(c)} if offset rn = row_number_column columns = columns.dup columns.delete(rn) end @columns = columns #if identifier_output_method each_opts[:as] = :array result.each(each_opts) do |r| h = {} cols.zip(r).each{|k, v| h[k] = v} h.delete(rn) if rn yield h end # Temporarily disable this optimization, as tiny_tds uses string keys # if result.fields is called before result.each(:symbolize_keys=>true). # See https://github.com/rails-sqlserver/tiny_tds/issues/57 else each_opts[:symbolize_keys] = true if offset result.each(each_opts) do |r| r.delete(rn) if rn yield r end else result.each(each_opts, &Proc.new) end end end self end
Create a named prepared statement that is stored in the database (and connection) for reuse.
# File lib/sequel/adapters/tinytds.rb, line 258 def prepare(type, name=nil, *values) ps = to_prepared_statement(type, values) ps.extend(PreparedStatementMethods) if name ps.prepared_statement_name = name db.set_prepared_statement(name, ps) end ps end
Generated with the Darkfish Rdoc Generator 2.