Class: Sequel::JDBC::Pervasive::Dataset

Inherits:
JDBC::Dataset
  • Object
show all
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

Instance Method Details

#literal_falseObject



122
123
124
# File 'lib/sequel/adapters/jdbc/pervasive.rb', line 122

def literal_false
  BOOL_FALSE
end

#literal_trueObject



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
  meta = result.
  cols = []
  i = 0
  meta.getColumnCount.times{cols << [output_identifier(meta.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_methodsObject



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

Returns:

  • (Boolean)


142
143
144
# File 'lib/sequel/adapters/jdbc/pervasive.rb', line 142

def supports_is_true?
  false
end