Module: Sequel::Oracle::DatasetMethods
- Included in:
- JDBC::Oracle::Dataset, Dataset
- Defined in:
- lib/sequel/adapters/shared/oracle.rb
Constant Summary collapse
- SELECT_CLAUSE_METHODS =
Dataset.clause_methods(:select, %w'with distinct columns from join where group having compounds order limit')
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#except(dataset, opts = {}) ⇒ Object
Oracle uses MINUS instead of EXCEPT, and doesn’t support EXCEPT ALL.
-
#insert(*args) ⇒ Object
If this dataset is associated with a sequence, return the most recently inserted sequence value.
-
#requires_sql_standard_datetimes? ⇒ Boolean
Oracle requires SQL standard datetimes.
-
#sequence(s) ⇒ Object
Create a copy of this dataset associated to the given sequence name, which will be used when calling insert to find the most recently inserted value for the sequence.
-
#supports_intersect_except_all? ⇒ Boolean
Oracle does not support INTERSECT ALL or EXCEPT ALL.
-
#supports_timestamp_timezones? ⇒ Boolean
Oracle supports timezones in literal timestamps.
-
#supports_window_functions? ⇒ Boolean
Oracle supports window functions.
Instance Method Details
#empty? ⇒ Boolean
106 107 108 |
# File 'lib/sequel/adapters/shared/oracle.rb', line 106 def empty? db[:dual].where(exists).get(1) == nil end |
#except(dataset, opts = {}) ⇒ Object
Oracle uses MINUS instead of EXCEPT, and doesn’t support EXCEPT ALL
100 101 102 103 104 |
# File 'lib/sequel/adapters/shared/oracle.rb', line 100 def except(dataset, opts={}) opts = {:all=>opts} unless opts.is_a?(Hash) raise(Sequel::Error, "EXCEPT ALL not supported") if opts[:all] compound_clone(:minus, dataset, opts) end |
#insert(*args) ⇒ Object
If this dataset is associated with a sequence, return the most recently inserted sequence value.
112 113 114 115 116 117 118 119 |
# File 'lib/sequel/adapters/shared/oracle.rb', line 112 def insert(*args) r = super if s = opts[:sequence] with_sql("SELECT #{literal(s)}.currval FROM dual").single_value.to_i else r end end |
#requires_sql_standard_datetimes? ⇒ Boolean
Oracle requires SQL standard datetimes
122 123 124 |
# File 'lib/sequel/adapters/shared/oracle.rb', line 122 def requires_sql_standard_datetimes? true end |
#sequence(s) ⇒ Object
Create a copy of this dataset associated to the given sequence name, which will be used when calling insert to find the most recently inserted value for the sequence.
129 130 131 |
# File 'lib/sequel/adapters/shared/oracle.rb', line 129 def sequence(s) clone(:sequence=>s) end |
#supports_intersect_except_all? ⇒ Boolean
Oracle does not support INTERSECT ALL or EXCEPT ALL
134 135 136 |
# File 'lib/sequel/adapters/shared/oracle.rb', line 134 def supports_intersect_except_all? false end |
#supports_timestamp_timezones? ⇒ Boolean
Oracle supports timezones in literal timestamps.
139 140 141 |
# File 'lib/sequel/adapters/shared/oracle.rb', line 139 def true end |
#supports_window_functions? ⇒ Boolean
Oracle supports window functions
144 145 146 |
# File 'lib/sequel/adapters/shared/oracle.rb', line 144 def supports_window_functions? true end |