Class: Sequel::JDBC::Pervasive::Dataset
- Inherits:
-
JDBC::Dataset
- Object
- JDBC::Dataset
- Sequel::JDBC::Pervasive::Dataset
- Defined in:
- lib/sequel/adapters/jdbc/pervasive.rb
Constant Summary collapse
- BOOL_TRUE =
'TRUE'.freeze
- BOOL_FALSE =
'FALSE'.freeze
- SELECT_CLAUSE_METHODS =
Dataset.clause_methods(:select, %w'limit columns from where')
Instance Method Summary collapse
- #literal_false ⇒ Object
- #literal_true ⇒ Object
- #process_result_set(result) ⇒ Object
- #quoted_identifier(name) ⇒ Object
- #select_clause_methods ⇒ Object
- #select_limit_sql(sql) ⇒ Object
- #supports_is_true? ⇒ Boolean
Instance Method Details
#literal_false ⇒ Object
122 123 124 |
# File 'lib/sequel/adapters/jdbc/pervasive.rb', line 122 def literal_false BOOL_FALSE end |
#literal_true ⇒ Object
126 127 128 |
# File 'lib/sequel/adapters/jdbc/pervasive.rb', line 126 def literal_true BOOL_TRUE end |
#process_result_set(result) ⇒ Object
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/sequel/adapters/jdbc/pervasive.rb', line 146 def process_result_set(result) # get column names = result.getMetaData cols = [] i = 0 .getColumnCount.times{cols << [output_identifier(.getColumnLabel(i+=1)), i]} @columns = cols.map{|c| c.at(0)} row = {} blk = if @convert_types lambda{ |n, i| row[n] = convert_type(result.getObject(i)) } else lambda{|n, i| row[n] = result.getObject(i)} end # get rows while result.next row = {} cols.each(&blk) yield row end end |
#quoted_identifier(name) ⇒ Object
118 119 120 |
# File 'lib/sequel/adapters/jdbc/pervasive.rb', line 118 def quoted_identifier(name) "[#{name}]" end |
#select_clause_methods ⇒ Object
130 131 132 |
# File 'lib/sequel/adapters/jdbc/pervasive.rb', line 130 def select_clause_methods SELECT_CLAUSE_METHODS end |
#select_limit_sql(sql) ⇒ Object
134 135 136 137 138 139 140 |
# File 'lib/sequel/adapters/jdbc/pervasive.rb', line 134 def select_limit_sql(sql) if @opts[:limit] sql << "SELECT TOP #{@opts[:limit]}" else sql << "SELECT" end end |
#supports_is_true? ⇒ Boolean
142 143 144 |
# File 'lib/sequel/adapters/jdbc/pervasive.rb', line 142 def supports_is_true? false end |