class OCI8

def to_auth_mode(privilege)

Other tags:
    Private: -
def to_auth_mode(privilege)
  case privilege
  when :SYSDBA
    0x00000002 # OCI_SYSDBA in oci.h
  when :SYSOPER
    0x00000004 # OCI_SYSOPER in oci.h
  when :SYSASM
    if OCI8.oracle_client_version < OCI8::ORAVER_11_1
      raise "SYSASM is not supported on Oracle version #{OCI8.oracle_client_version}"
    end
    0x00008000 # OCI_SYSASM in oci.h
  when :SYSBACKUP
    if OCI8.oracle_client_version < OCI8::ORAVER_12_1
      raise "SYSBACKUP is not supported on Oracle version #{OCI8.oracle_client_version}"
    end
    0x00020000 # OCI_SYSBKP in oci.h
  when :SYSDG
    if OCI8.oracle_client_version < OCI8::ORAVER_12_1
      raise "SYSDG is not supported on Oracle version #{OCI8.oracle_client_version}"
    end
    0x00040000 # OCI_SYSDGD in oci.h
  when :SYSKM
    if OCI8.oracle_client_version < OCI8::ORAVER_12_1
      raise "SYSKM is not supported on Oracle version #{OCI8.oracle_client_version}"
    end
    0x00080000 # OCI_SYSKMT in oci.h
  when nil
    0 # OCI_DEFAULT
  else
    raise "unknown privilege type #{privilege}"
  end
end