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
374 def convert_smallint_to_bool
375   opts.has_key?(:convert_smallint_to_bool) ? opts[:convert_smallint_to_bool] : db.convert_smallint_to_bool
376 end
fetch_rows(sql) { |row| ... } click to toggle source
    # File lib/sequel/adapters/ibmdb.rb
383 def fetch_rows(sql)
384   execute(sql) do |stmt|
385     columns = []
386     convert = convert_smallint_to_bool
387     cps = db.conversion_procs
388     stmt.num_fields.times do |i|
389       k = stmt.field_name i
390       key = output_identifier(k)
391       type = stmt.field_type(i).downcase.to_sym
392       # decide if it is a smallint from precision
393       type = :boolean  if type == :int && convert && stmt.field_precision(i) < 8
394       type = :blob if type == :clob && db.use_clob_as_blob
395       columns << [key, cps[type]]
396     end
397     cols = columns.map{|c| c[0]}
398     self.columns = cols
399 
400     while res = stmt.fetch_array
401       row = {}
402       res.zip(columns).each do |v, (k, pr)|
403         row[k] = ((pr ? pr.call(v) : v) if v)
404       end
405       yield row
406     end
407   end
408   self
409 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
379 def with_convert_smallint_to_bool(v)
380   clone(:convert_smallint_to_bool=>v)
381 end

Private Instance Methods

bound_variable_modules() click to toggle source
    # File lib/sequel/adapters/ibmdb.rb
413 def bound_variable_modules
414   [CallableStatementMethods]
415 end
prepared_statement_modules() click to toggle source
    # File lib/sequel/adapters/ibmdb.rb
417 def prepared_statement_modules
418   [PreparedStatementMethods]
419 end