Class Sequel::Firebird::Dataset
In: lib/sequel/adapters/firebird.rb
Parent: Sequel::Dataset

Dataset class for Firebird datasets

Methods

Constants

BOOL_TRUE = '1'.freeze
BOOL_FALSE = '0'.freeze
NULL = LiteralString.new('NULL').freeze
COMMA_SEPARATOR = ', '.freeze
SELECT_CLAUSE_METHODS = clause_methods(:select, %w'with distinct limit columns from join where group having compounds order')
INSERT_CLAUSE_METHODS = clause_methods(:insert, %w'into columns values returning_select')

Public Instance methods

Yield all rows returned by executing the given SQL and converting the types.

[Source]

     # File lib/sequel/adapters/firebird.rb, line 207
207:       def fetch_rows(sql)
208:         execute(sql) do |s|
209:           begin
210:             @columns = s.fields.map{|c| output_identifier(c.name)}
211:             s.fetchall(:symbols_hash).each do |r|
212:               h = {}
213:               r.each{|k,v| h[output_identifier(k)] = v}
214:               yield h
215:             end
216:           ensure
217:             s.close
218:           end
219:         end
220:         self
221:       end

Insert given values into the database.

[Source]

     # File lib/sequel/adapters/firebird.rb, line 224
224:       def insert(*values)
225:         if !@opts[:sql]
226:           clone(default_server_opts(:sql=>insert_returning_pk_sql(*values))).single_value
227:         else
228:           execute_insert(insert_sql(*values), :table=>opts[:from].first,
229:             :values=>values.size == 1 ? values.first : values)
230:         end
231:       end

Use the RETURNING clause to return the primary key of the inserted record, if it exists

[Source]

     # File lib/sequel/adapters/firebird.rb, line 234
234:       def insert_returning_pk_sql(*values)
235:         pk = db.primary_key(opts[:from].first)
236:         insert_returning_sql(pk ? Sequel::SQL::Identifier.new(pk) : NULL, *values)
237:       end

Use the RETURNING clause to return the columns listed in returning.

[Source]

     # File lib/sequel/adapters/firebird.rb, line 240
240:       def insert_returning_sql(returning, *values)
241:         "#{insert_sql(*values)} RETURNING #{column_list(Array(returning))}"
242:       end

Insert a record returning the record inserted

[Source]

     # File lib/sequel/adapters/firebird.rb, line 245
245:       def insert_select(*values)
246:         naked.clone(default_server_opts(:sql=>insert_returning_sql(nil, *values))).single_record
247:       end

[Source]

     # File lib/sequel/adapters/firebird.rb, line 249
249:       def requires_sql_standard_datetimes?
250:         true
251:       end

[Source]

     # File lib/sequel/adapters/firebird.rb, line 253
253:       def supports_insert_select?
254:         true
255:       end

Firebird does not support INTERSECT or EXCEPT

[Source]

     # File lib/sequel/adapters/firebird.rb, line 258
258:       def supports_intersect_except?
259:         false
260:       end

[Validate]