Module: Sequel::Firebird::DatasetMethods

Defined in:
lib/sequel/adapters/shared/firebird.rb

Constant Summary

BOOL_TRUE =
'1'.freeze
BOOL_FALSE =
'0'.freeze
NULL =
LiteralString.new('NULL').freeze
FIRST =
" FIRST ".freeze
SKIP =
" SKIP ".freeze
DEFAULT_FROM =
" FROM RDB$DATABASE"

Instance Method Summary collapse

Instance Method Details

#insert(*values) ⇒ Object

Insert given values into the database.



170
171
172
173
174
175
176
# File 'lib/sequel/adapters/shared/firebird.rb', line 170

def insert(*values)
  if @opts[:sql] || @opts[:returning]
    super
  else
    returning(insert_pk).insert(*values){|r| return r.values.first}
  end
end

#insert_select(*values) ⇒ Object

Insert a record returning the record inserted



179
180
181
# File 'lib/sequel/adapters/shared/firebird.rb', line 179

def insert_select(*values)
  with_sql_first(insert_select_sql(*values))
end

#insert_select_sql(*values) ⇒ Object

The SQL to use for an insert_select, adds a RETURNING clause to the insert unless the RETURNING clause is already present.



185
186
187
188
# File 'lib/sequel/adapters/shared/firebird.rb', line 185

def insert_select_sql(*values)
  ds = opts[:returning] ? self : returning
  ds.insert_sql(*values)
end

#requires_sql_standard_datetimes?Boolean



190
191
192
# File 'lib/sequel/adapters/shared/firebird.rb', line 190

def requires_sql_standard_datetimes?
  true
end

#supports_cte?(type = :select) ⇒ Boolean



194
195
196
# File 'lib/sequel/adapters/shared/firebird.rb', line 194

def supports_cte?(type=:select)
  type == :select
end

#supports_insert_select?Boolean



198
199
200
# File 'lib/sequel/adapters/shared/firebird.rb', line 198

def supports_insert_select?
  true
end

#supports_intersect_except?Boolean

Firebird does not support INTERSECT or EXCEPT



203
204
205
# File 'lib/sequel/adapters/shared/firebird.rb', line 203

def supports_intersect_except?
  false
end

#supports_returning?(type) ⇒ Boolean



207
208
209
# File 'lib/sequel/adapters/shared/firebird.rb', line 207

def supports_returning?(type)
  type == :insert
end