goracle

package module
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

README

Build Status GoDoc

goracle

goracle is a package which is a database/sql/driver.Driver for connecting to Oracle DB, using Anthony Tuininga's excellent OCI wrapper, ODPI-C.

Install

It is go get'able with go get gopkg.in/goracle.v2 iff you have ODPI-C installed.

Otherwise, after the go get failed, Install ODPI

cd $GOPATH/src/gopkg.in/goracle.v2/odpi
make
sudo cp -a lib/libodpic.so /usr/local/lib/
sudo ldconfig /usr/local/lib
cd ..

go install

.

Documentation

Overview

Package goracle is a database/sql/driver for Oracle DB.

Index

Constants

View Source
const (
	// DpiMajorVersion is the wanted major version of the underlying ODPI-C library.
	DpiMajorVersion = 2
	// DpiMinorVersion is the wanted minor version of the underlying ODPI-C library.
	DpiMinorVersion = 0

	// DriverName is set on the connection to be seen in the DB
	DriverName = "gopkg.in/rana/ora.v5 : " + Version
)
View Source
const CheckLOBWrite = true
View Source
const PlSQLArrays = Option(1)

PlSQLArrays is to signal that the slices given in arguments of Exec to be left as is - the default is to treat them as arguments for ExecMany.

View Source
const Version = "v5.0.0"

Version of this driver

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name       string
	OracleType C.dpiOracleTypeNum
	NativeType C.dpiNativeTypeNum
	Size       C.uint32_t
	Precision  C.int16_t
	Scale      C.int8_t
	Nullable   bool
	ObjectType *C.dpiObjectType
}

Column holds the info from a column.

type DirectLob

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

func (DirectLob) Begin deprecated

func (c DirectLob) Begin() (driver.Tx, error)

Begin starts and returns a new transaction.

Deprecated: Drivers should implement ConnBeginTx instead (or additionally).

func (DirectLob) BeginTx

func (c DirectLob) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)

BeginTx starts and returns a new transaction. If the context is canceled by the user the sql package will call Tx.Rollback before discarding and closing the connection.

This must check opts.Isolation to determine if there is a set isolation level. If the driver does not support a non-default level and one is set or if there is a non-default isolation level that is not supported, an error must be returned.

This must also check opts.ReadOnly to determine if the read-only value is true to either set the read-only transaction property if supported or return an error if it is not supported.

func (DirectLob) Break

func (c DirectLob) Break() error

func (*DirectLob) Close

func (dl *DirectLob) Close() error

func (DirectLob) Commit

func (c DirectLob) Commit() error

func (DirectLob) Ping

func (c DirectLob) Ping(ctx context.Context) error

func (DirectLob) Prepare

func (c DirectLob) Prepare(query string) (driver.Stmt, error)

Prepare returns a prepared statement, bound to this connection.

func (DirectLob) PrepareContext

func (c DirectLob) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)

PrepareContext returns a prepared statement, bound to this connection. context is for the preparation of the statement, it must not store the context within the statement itself.

func (*DirectLob) ReadAt

func (dl *DirectLob) ReadAt(p []byte, offset int64) (int, error)

func (DirectLob) Rollback

func (c DirectLob) Rollback() error

func (*DirectLob) WriteAt

func (dl *DirectLob) WriteAt(p []byte, offset int64) (int, error)

type Lob

type Lob struct {
	io.Reader
	IsClob bool
}

Lob is for reading/writing a LOB.

func (*Lob) Hijack

func (lob *Lob) Hijack() (*DirectLob, error)

Hijack the underlying lob reader/writer, and return a DirectLob for reading/writing the lob directly.

After this, the Lob is unusable!

type Option

type Option uint8

Option for NamedArgs

Jump to

Keyboard shortcuts

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