Class/Module Index [+]

Quicksearch

Sequel::Oracle::Database

Constants

CONNECTION_ERROR_CODES

ORA-00028: your session has been killed ORA-01012: not logged on ORA-03113: end-of-file on communication channel ORA-03114: not connected to ORACLE

Public Instance Methods

connect(server) click to toggle source
# File lib/sequel/adapters/oracle.rb, line 16
def connect(server)
  opts = server_opts(server)
  if opts[:database]
    dbname = opts[:host] ?              "//#{opts[:host]}#{":#{opts[:port]}" if opts[:port]}/#{opts[:database]}" : opts[:database]
  else
    dbname = opts[:host]
  end
  conn = OCI8.new(opts[:user], opts[:password], dbname, opts[:privilege])
  conn.autocommit = true
  conn.non_blocking = true
  conn
end
dataset(opts = nil) click to toggle source
# File lib/sequel/adapters/oracle.rb, line 30
def dataset(opts = nil)
  Oracle::Dataset.new(self, opts)
end
do(sql, opts={}) click to toggle source
Alias for: execute
execute(sql, opts={}) click to toggle source
# File lib/sequel/adapters/oracle.rb, line 62
def execute(sql, opts={})
  synchronize(opts[:server]) do |conn|
    begin
      r = log_yield(sql){conn.exec(sql)}
      yield(r) if block_given?
      r
    rescue OCIException => e
      raise_error(e, :disconnect=>CONNECTION_ERROR_CODES.include?(e.code))
    end
  end
end
Also aliased as: do
schema_parse_table(table, opts={}) click to toggle source
# File lib/sequel/adapters/oracle.rb, line 34
def schema_parse_table(table, opts={})
  ds = dataset
  ds.identifier_output_method = :downcase
  schema, table = schema_and_table(table)
  table_schema = []
  metadata = transaction(opts){|conn| conn.describe_table(table.to_s)}
  metadata.columns.each do |column|
    table_schema << [
      column.name.downcase.to_sym,
      {
        :type => column.data_type,
        :db_type => column.type_string.split(' ')[0],
        :type_string => column.type_string,
        :charset_form => column.charset_form,
        :char_used => column.char_used?,
        :char_size => column.char_size,
        :data_size => column.data_size,
        :precision => column.precision,
        :scale => column.scale,
        :fsprecision => column.fsprecision,
        :lfprecision => column.lfprecision,
        :allow_null => column.nullable?
      }
    ]
  end
  table_schema
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.