class Sequel::IBMDB::Dataset
Constants
- PreparedStatementMethods
Public Instance Methods
convert_smallint_to_bool()
click to toggle source
Whether to convert smallint to boolean arguments for this dataset. Defaults to the Database setting.
# File lib/sequel/adapters/ibmdb.rb, line 374 def convert_smallint_to_bool opts.has_key?(:convert_smallint_to_bool) ? opts[:convert_smallint_to_bool] : db.convert_smallint_to_bool end
fetch_rows(sql) { |row| ... }
click to toggle source
# File lib/sequel/adapters/ibmdb.rb, line 383 def fetch_rows(sql) execute(sql) do |stmt| columns = [] convert = convert_smallint_to_bool cps = db.conversion_procs stmt.num_fields.times do |i| k = stmt.field_name i key = output_identifier(k) type = stmt.field_type(i).downcase.to_sym # decide if it is a smallint from precision type = :boolean if type == :int && convert && stmt.field_precision(i) < 8 type = :blob if type == :clob && db.use_clob_as_blob columns << [key, cps[type]] end cols = columns.map{|c| c[0]} self.columns = cols while res = stmt.fetch_array row = {} res.zip(columns).each do |v, (k, pr)| row[k] = ((pr ? pr.call(v) : v) if v) end yield row end end self end
with_convert_smallint_to_bool(v)
click to toggle source
Return a cloned dataset with the #convert_smallint_to_bool option set.
# File lib/sequel/adapters/ibmdb.rb, line 379 def with_convert_smallint_to_bool(v) clone(:convert_smallint_to_bool=>v) end
Private Instance Methods
bound_variable_modules()
click to toggle source
# File lib/sequel/adapters/ibmdb.rb, line 413 def bound_variable_modules [CallableStatementMethods] end
prepared_statement_modules()
click to toggle source
# File lib/sequel/adapters/ibmdb.rb, line 417 def prepared_statement_modules [PreparedStatementMethods] end