Yield hashes with symbol keys, attempting to optimize for various cases.
# File lib/sequel/adapters/tinytds.rb, line 231 def fetch_rows(sql) execute(sql) do |result| columns = result.fields.map!{|c| output_identifier(c)} if columns.empty? args = [] args << {:timezone=>:utc} if db.timezone == :utc cols = nil result.each(*args) do |r| unless cols cols = result.fields.map{|c| [c, output_identifier(c)]} @columns = columns = cols.map{|c| c.last} end h = {} cols.each do |s, sym| h[sym] = r[s] end yield h end else @columns = columns if db.timezone == :utc result.each(:timezone=>:utc){|r| yield r} else result.each{|r| yield r} 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 263 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.