Module: Sequel::Oracle::DatabaseMethods

Included in:
JDBC::Oracle::DatabaseMethods, Database
Defined in:
lib/sequel/lib/sequel/adapters/shared/oracle.rb

Constant Summary collapse

TEMPORARY =
'GLOBAL TEMPORARY '.freeze
AUTOINCREMENT =
''.freeze

Instance Method Summary collapse

Instance Method Details

#create_sequence(name, opts = {}) ⇒ Object


7
8
9
# File 'lib/sequel/lib/sequel/adapters/shared/oracle.rb', line 7

def create_sequence(name, opts={})
  self << create_sequence_sql(name, opts)
end

#create_trigger(*args) ⇒ Object


11
12
13
# File 'lib/sequel/lib/sequel/adapters/shared/oracle.rb', line 11

def create_trigger(*args)
  self << create_trigger_sql(*args)
end

#database_typeObject

Oracle uses the :oracle database type


20
21
22
# File 'lib/sequel/lib/sequel/adapters/shared/oracle.rb', line 20

def database_type
  :oracle
end

#drop_sequence(name) ⇒ Object


15
16
17
# File 'lib/sequel/lib/sequel/adapters/shared/oracle.rb', line 15

def drop_sequence(name)
  self << drop_sequence_sql(name)
end

#table_exists?(name) ⇒ Boolean


29
30
31
# File 'lib/sequel/lib/sequel/adapters/shared/oracle.rb', line 29

def table_exists?(name)
  from(:tab).filter(:tname =>dataset.send(:input_identifier, name), :tabtype => 'TABLE').count > 0
end

#tables(opts = {}) ⇒ Object


24
25
26
27
# File 'lib/sequel/lib/sequel/adapters/shared/oracle.rb', line 24

def tables(opts={})
  ds = from(:tab).server(opts[:server]).select(:tname).filter(:tabtype => 'TABLE')
  ds.map{|r| ds.send(:output_identifier, r[:tname])}
end