Override the default IBMDB.convert_smallint_to_bool setting for this dataset.
Emulate support of bind arguments in called statements.
# File lib/sequel/adapters/ibmdb.rb, line 412 def call(type, bind_arguments={}, *values, &block) ps = to_prepared_statement(type, values) ps.extend(CallableStatementMethods) ps.call(bind_arguments, &block) end
Whether to convert smallint to boolean arguments for this dataset. Defaults to the IBMDB module setting.
# File lib/sequel/adapters/ibmdb.rb, line 420 def convert_smallint_to_bool defined?(@convert_smallint_to_bool) ? @convert_smallint_to_bool : (@convert_smallint_to_bool = IBMDB.convert_smallint_to_bool) end
Fetch the rows from the database and yield plain hashes.
# File lib/sequel/adapters/ibmdb.rb, line 428 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(k).downcase.to_sym # decide if it is a smallint from precision type = :boolean if type ==:int && convert && stmt.field_precision(k) < 8 columns << [key, cps[type]] end cols = columns.map{|c| c.at(0)} @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
Store the given type of prepared statement in the associated database with the given name.
# File lib/sequel/adapters/ibmdb.rb, line 457 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.