go_ora

package module
v2.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 34 Imported by: 336

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildUrl added in v2.2.5

func BuildUrl(server string, port int, service, user, password string, options map[string]string) string

func EncryptPassword

func EncryptPassword(password, key []byte, padding bool) (string, error)

func EncryptSessionKey

func EncryptSessionKey(padding bool, encKey []byte, sessionKey []byte) (string, error)

func HexStringToBytes

func HexStringToBytes(input string) ([]byte, error)

func NewWallet added in v2.1.24

func NewWallet(filePath string) (*wallet, error)

func TZBytes

func TZBytes() []byte

Types

type AuthObject

type AuthObject struct {
	EServerSessKey string
	EClientSessKey string
	EPassword      string
	ESpeedyKey     string
	ServerSessKey  []byte
	ClientSessKey  []byte
	KeyHash        []byte
	Salt           string

	VerifierType int
	// contains filtered or unexported fields
}

E infront of the variable means encrypted

func NewAuthObject

func NewAuthObject(username string, password string, tcpNego *TCPNego, session *network.Session) (*AuthObject, error)

func (*AuthObject) TestResponse

func (obj *AuthObject) TestResponse(password, pbkdf2ChkSalt string, vGenCount, sDerCount int) error

func (*AuthObject) VerifyResponse

func (obj *AuthObject) VerifyResponse(response string) bool

func (*AuthObject) Write

func (obj *AuthObject) Write(connOption *network.ConnectionOption, mode LogonMode, session *network.Session) error

type Connection

type Connection struct {
	State     ConnectionState
	LogonMode LogonMode

	SessionProperties map[string]string

	NLSData NLSData
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(databaseUrl string) (*Connection, error)

func (*Connection) Begin

func (conn *Connection) Begin() (driver.Tx, error)

func (*Connection) Close

func (conn *Connection) Close() (err error)

func (*Connection) GetNLS

func (conn *Connection) GetNLS() (*NLSData, error)

func (*Connection) Open

func (conn *Connection) Open() error

func (*Connection) Ping

func (conn *Connection) Ping(_ context.Context) error

func (*Connection) Prepare

func (conn *Connection) Prepare(query string) (driver.Stmt, error)

func (*Connection) RegisterType added in v2.2.6

func (conn *Connection) RegisterType(owner, typeName string, typeObj interface{}) error

func (*Connection) RegisterType2 added in v2.2.7

func (conn *Connection) RegisterType2(typeName string, typeObj interface{}) error

func (*Connection) SetStringConverter added in v2.2.6

func (conn *Connection) SetStringConverter(converter converters.IStringConverter)

type ConnectionState

type ConnectionState int
const (
	Closed ConnectionState = 0
	Opened ConnectionState = 1
)

type ConnectionString

type ConnectionString struct {
	DataSource            string
	Host                  string
	Port                  int
	SID                   string
	ServiceName           string
	InstanceName          string
	DBAPrivilege          DBAPrivilege
	EnList                EnList
	ConnectionLifeTime    int
	IncrPoolSize          int
	DecrPoolSize          int
	MaxPoolSize           int
	MinPoolSize           int
	Password              string
	PasswordSecurityInfo  bool
	Pooling               bool
	ConnectionTimeOut     int
	UserID                string
	PromotableTransaction PromotableTransaction
	ProxyUserID           string
	ProxyPassword         string
	ValidateConnection    bool
	StmtCacheSize         int
	StmtCachePurge        bool
	HaEvent               bool
	LoadBalance           bool
	MetadataBooling       bool
	ContextConnection     bool
	SelfTuning            bool
	SSL                   bool
	SSLVerify             bool
	ApplicationEdition    string
	PoolRegulator         int
	ConnectionPoolTimeout int
	Trace                 string // Trace file
	PrefetchRows          int
	WalletPath            string
	// contains filtered or unexported fields
}

func NewConnectionString

func NewConnectionString() *ConnectionString

type DBAPrivilege

type DBAPrivilege int
const (
	NONE    DBAPrivilege = 0
	SYSDBA  DBAPrivilege = 0x20
	SYSOPER DBAPrivilege = 0x40
)

func DBAPrivilegeFromString

func DBAPrivilegeFromString(s string) DBAPrivilege

type DBVersion

type DBVersion struct {
	Info            string
	Text            string
	Number          uint16
	MajorVersion    int
	MinorVersion    int
	PatchsetVersion int
	// contains filtered or unexported fields
}

func GetDBVersion

func GetDBVersion(session *network.Session) (*DBVersion, error)

type DataSet

type DataSet struct {
	ColumnCount     int
	RowCount        int
	UACBufferLength int
	MaxRowSize      int
	Cols            []ParameterInfo
	Rows            []Row
	// contains filtered or unexported fields
}

func (*DataSet) Close

func (dataSet *DataSet) Close() error

func (DataSet) ColumnTypeDatabaseTypeName

func (dataSet DataSet) ColumnTypeDatabaseTypeName(index int) string

func (DataSet) ColumnTypeLength

func (dataSet DataSet) ColumnTypeLength(index int) (length int64, ok bool)

func (DataSet) ColumnTypeNullable

func (dataSet DataSet) ColumnTypeNullable(index int) (nullable, ok bool)

func (*DataSet) Columns

func (dataSet *DataSet) Columns() []string

func (*DataSet) Next

func (dataSet *DataSet) Next(dest []driver.Value) error

func (DataSet) Trace

func (dataSet DataSet) Trace(t trace.Tracer)

type DataTypeNego

type DataTypeNego struct {
	MessageCode        uint8
	Server             *TCPNego
	TypeAndRep         []int16
	RuntimeTypeAndRep  []int16
	DataTypeRepFor1100 int16
	DataTypeRepFor1200 int16
	CompileTimeCaps    []byte
	RuntimeCap         []byte
	DBTimeZone         []byte
	// contains filtered or unexported fields
}

type EnList

type EnList int
const (
	FALSE   EnList = 0
	TRUE    EnList = 1
	DYNAMIC EnList = 2
)

func EnListFromString

func EnListFromString(s string) EnList

type Lob

type Lob struct {
	// contains filtered or unexported fields
}

type LogonMode

type LogonMode int
const (
	NoNewPass LogonMode = 0x1
	//WithNewPass LogonMode = 0x2
	SysDba      LogonMode = 0x20 // no verify response from server
	SysOper     LogonMode = 0x40 // no verify response from server
	UserAndPass LogonMode = 0x100
)

type NLSData

type NLSData struct {
	Calender        string
	Comp            string
	Language        string
	LengthSemantics string
	NCharConvExcep  string
	NCharConvImp    string
	DateLang        string
	Sort            string
	Currency        string
	DateFormat      string
	TimeFormat      string
	IsoCurrency     string
	NumericChars    string
	DualCurrency    string
	UnionCurrency   string
	Timestamp       string
	TimestampTZ     string
	TTimezoneFormat string
	NTimezoneFormat string
	Territory       string
	Charset         string
}

func (*NLSData) SaveNLSValue

func (nls *NLSData) SaveNLSValue(key, value string, code int)

type NVarChar added in v2.1.20

type NVarChar string

func (*NVarChar) Value added in v2.1.20

func (n *NVarChar) Value() (driver.Value, error)

type OracleDriver added in v2.2.6

type OracleDriver struct {
	Conn    *Connection
	Server  string
	Service string
	UserId  string
}

func (*OracleDriver) Open added in v2.2.6

func (drv *OracleDriver) Open(name string) (driver.Conn, error)

type OracleType

type OracleType int
const (
	NCHAR            OracleType = 1
	NUMBER           OracleType = 2
	SB1              OracleType = 3
	SB2              OracleType = 3
	SB4              OracleType = 3
	FLOAT            OracleType = 4
	NullStr          OracleType = 5
	VarNum           OracleType = 6
	LONG             OracleType = 8
	VARCHAR          OracleType = 9
	ROWID            OracleType = 11
	DATE             OracleType = 12
	VarRaw           OracleType = 15
	BFloat           OracleType = 21
	BDouble          OracleType = 22
	RAW              OracleType = 23
	LongRaw          OracleType = 24
	UINT             OracleType = 68
	LongVarChar      OracleType = 94
	LongVarRaw       OracleType = 95
	CHAR             OracleType = 96
	CHARZ            OracleType = 97
	IBFloat          OracleType = 100
	IBDouble         OracleType = 101
	REFCURSOR        OracleType = 102
	OCIXMLType       OracleType = 108
	XMLType          OracleType = 109
	OCIRef           OracleType = 110
	OCIClobLocator   OracleType = 112
	OCIBlobLocator   OracleType = 113
	OCIFileLocator   OracleType = 114
	ResultSet        OracleType = 116
	OCIString        OracleType = 155
	OCIDate          OracleType = 156
	TimeStampDTY     OracleType = 180
	TimeStampTZ_DTY  OracleType = 181
	IntervalYM_DTY   OracleType = 182
	IntervalDS_DTY   OracleType = 183
	TimeTZ           OracleType = 186
	TimeStamp        OracleType = 187
	TimeStampTZ      OracleType = 188
	IntervalYM       OracleType = 189
	IntervalDS       OracleType = 190
	UROWID           OracleType = 208
	TimeStampLTZ_DTY OracleType = 231
	TimeStampeLTZ    OracleType = 232
)

func (OracleType) String

func (i OracleType) String() string

type ParameterDirection

type ParameterDirection int
const (
	Input  ParameterDirection = 1
	Output ParameterDirection = 2
	InOut  ParameterDirection = 3
	RetVal ParameterDirection = 9
)

type ParameterInfo

type ParameterInfo struct {
	Name                 string
	TypeName             string
	Direction            ParameterDirection
	IsNull               bool
	AllowNull            bool
	ColAlias             string
	DataType             OracleType
	IsXmlType            bool
	Flag                 uint8
	Precision            uint8
	Scale                uint8
	MaxLen               int
	MaxCharLen           int
	MaxNoOfArrayElements int
	ContFlag             int
	ToID                 []byte
	Version              int
	CharsetID            int
	CharsetForm          int
	BValue               []byte
	Value                driver.Value
	// contains filtered or unexported fields
}

type ParameterType

type ParameterType int
const (
	Number ParameterType = 1
	String ParameterType = 2
)

type PromotableTransaction

type PromotableTransaction int
const (
	Promotable PromotableTransaction = 1
	Local      PromotableTransaction = 0
)

type QueryResult

type QueryResult struct {
	// contains filtered or unexported fields
}

func (*QueryResult) LastInsertId

func (rs *QueryResult) LastInsertId() (int64, error)

func (*QueryResult) RowsAffected

func (rs *QueryResult) RowsAffected() (int64, error)

type RefCursor

type RefCursor struct {
	MaxRowSize int
	// contains filtered or unexported fields
}

func (*RefCursor) Close

func (cursor *RefCursor) Close() error

func (*RefCursor) Query

func (cursor *RefCursor) Query() (*DataSet, error)

type Row

type Row []driver.Value

type Stmt

type Stmt struct {
	// contains filtered or unexported fields
}

func NewStmt

func NewStmt(text string, conn *Connection) *Stmt

func (*Stmt) AddParam

func (stmt *Stmt) AddParam(name string, val driver.Value, size int, direction ParameterDirection)

func (*Stmt) AddRefCursorParam

func (stmt *Stmt) AddRefCursorParam(name string)

func (*Stmt) CheckNamedValue added in v2.1.20

func (stmt *Stmt) CheckNamedValue(named *driver.NamedValue) error

func (*Stmt) Close

func (stmt *Stmt) Close() error

func (*Stmt) Exec

func (stmt *Stmt) Exec(args []driver.Value) (driver.Result, error)

func (*Stmt) NewParam

func (stmt *Stmt) NewParam(name string, val driver.Value, size int, direction ParameterDirection) *ParameterInfo

func (*Stmt) NumInput

func (stmt *Stmt) NumInput() int

func (*Stmt) Query

func (stmt *Stmt) Query(args []driver.Value) (driver.Rows, error)

func (stmt *Stmt) reExec() (driver.Rows, error) {

}

type StmtInterface

type StmtInterface interface {
	// contains filtered or unexported methods
}

type StmtType

type StmtType int
const (
	SELECT StmtType = 1
	DML    StmtType = 2
	PLSQL  StmtType = 3
	OTHERS StmtType = 4
)

type TCPNego

type TCPNego struct {
	MessageCode           uint8
	ProtocolServerVersion uint8
	ProtocolServerString  string
	OracleVersion         int
	ServerCharset         int
	ServerFlags           uint8
	CharsetElem           int
	ServernCharset        int
	ServerCompileTimeCaps []byte
	ServerRuntimeCaps     []byte
}

func NewTCPNego

func NewTCPNego(session *network.Session) (*TCPNego, error)

type Transaction

type Transaction struct {
	// contains filtered or unexported fields
}

func (*Transaction) Commit

func (tx *Transaction) Commit() error

func (*Transaction) Rollback

func (tx *Transaction) Rollback() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL