Module: Sequel::Firebird::DatasetMethods
- Defined in:
- lib/sequel/adapters/shared/firebird.rb
Constant Summary collapse
- 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
-
#insert(*values) ⇒ Object
Insert given values into the database.
-
#insert_select(*values) ⇒ Object
Insert a record returning the record inserted.
-
#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.
- #requires_sql_standard_datetimes? ⇒ Boolean
- #supports_cte?(type = :select) ⇒ Boolean
- #supports_insert_select? ⇒ Boolean
-
#supports_intersect_except? ⇒ Boolean
Firebird does not support INTERSECT or EXCEPT.
- #supports_returning?(type) ⇒ Boolean
Instance Method Details
#insert(*values) ⇒ Object
Insert given values into the database.
172 173 174 175 176 177 178 |
# File 'lib/sequel/adapters/shared/firebird.rb', line 172 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
181 182 183 |
# File 'lib/sequel/adapters/shared/firebird.rb', line 181 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.
187 188 189 190 |
# File 'lib/sequel/adapters/shared/firebird.rb', line 187 def insert_select_sql(*values) ds = opts[:returning] ? self : returning ds.insert_sql(*values) end |
#requires_sql_standard_datetimes? ⇒ Boolean
192 193 194 |
# File 'lib/sequel/adapters/shared/firebird.rb', line 192 def requires_sql_standard_datetimes? true end |
#supports_cte?(type = :select) ⇒ Boolean
196 197 198 |
# File 'lib/sequel/adapters/shared/firebird.rb', line 196 def supports_cte?(type=:select) type == :select end |
#supports_insert_select? ⇒ Boolean
200 201 202 |
# File 'lib/sequel/adapters/shared/firebird.rb', line 200 def supports_insert_select? true end |
#supports_intersect_except? ⇒ Boolean
Firebird does not support INTERSECT or EXCEPT
205 206 207 |
# File 'lib/sequel/adapters/shared/firebird.rb', line 205 def supports_intersect_except? false end |
#supports_returning?(type) ⇒ Boolean
209 210 211 |
# File 'lib/sequel/adapters/shared/firebird.rb', line 209 def supports_returning?(type) type == :insert end |