Documentation
¶
Index ¶
- Constants
- Variables
- type Conn
- type Descriptor
- type Library
- type LibraryProc
- type Lob
- type LobReader
- type OraValueConverter
- type QueryResult
- type Result
- type Rows
- type Statement
- func (stmt *Statement) Close() error
- func (stmt *Statement) ColumnConverter(idx int) driver.ValueConverter
- func (stmt *Statement) Exec(args []driver.Value) (driver.Result, error)
- func (stmt *Statement) NumInput() int
- func (stmt *Statement) Query(args []driver.Value) (driver.Rows, error)
- func (stmt *Statement) SetPrefrech(n int) (err error)
- type Transaction
Constants ¶
const ( OCI_HTYPE_ENV = 1 OCI_HTYPE_ERROR = 2 OCI_HTYPE_SVCCTX = 3 OCI_HTYPE_STMT = 4 )
http://docs.oracle.com/cd/E11882_01/appdev.112/e10646/oci02bas.htm#g466063
const ( OCI_BATCH_MODE = 0x1 OCI_COMMIT_ON_SUCCESS = 0x20 OCI_BATCH_ERRORS = 0x80 )
const ( OCI_DTYPE_LOB = 50 OCI_DTYPE_PARAM = 53 OCI_DTYPE_ROWID = 54 )
const ( OCI_ATTR_CHAR_USED = 285 OCI_ATTR_CHAR_SIZE = 286 )
const ( OCI_ATTR_DATA_SIZE = 1 OCI_ATTR_DATA_TYPE = 2 OCI_ATTR_DISP_SIZE = 3 OCI_ATTR_NAME = 4 OCI_ATTR_PREFETCH_ROWS = 11 OCI_ATTR_ROWID = 19 OCI_ATTR_FETCH_ROWID = 448 )
const ( OCI_TYP_VARCHAR = 1 // 40000byte, ora12 -> 32k OCI_TYP_NUMBER = 2 // [21]byte, can be casted, float64, int64, string OCI_TYP_DATE = 12 OCI_TYP_ROWID = 104 // this is strange, docs say it is 69, but in practice it is 104 // working progress OCI_TYP_LONG = 8 OCI_TYP_CHAR = 96 // unsupported by this driver OCI_TYP_RAW = 23 OCI_TYP_LONG_RAW = 24 OCI_TYP_BINARY_FLOAT = 100 OCI_TYP_BINARY_DOUBLE = 100 OCI_TYP_CLOB = 112 OCI_TYP_BLOB = 113 OCI_TYP_BFILE = 114 OCI_TYP_TIMESTAMP = 180 )
internal data types: http://docs.oracle.com/cd/E11882_01/appdev.112/e10646/oci03typ.htm#CEGGBDFC
const ( SQLT_CHR = 1 // [n]byte SQLT_NUM = 2 // float64? SQLT_INT = 3 // int64 SQLT_FLT = 4 // float64 SQLT_STR = 5 // [n+1]byte SQLT_LNG = 8 // [n]char SQLT_DAT = 12 // [7]byte SQLT_AFC = 96 // [n]char SQLT_CLOB = 112 SQLT_RDD = 104 )
external data types http://docs.oracle.com/cd/E11882_01/appdev.112/e10646/oci03typ.htm#LNOCI16271
const ( OCI_SUCCESS = 0 OCI_SUCCESS_WITH_INFO = 1 OCI_NO_DATA = 100 OCI_ERROR = -1 OCI_INVALID_HANDLE = -2 OCI_NEED_DATA = 99 OCI_STILL_EXECUTING = -3123 OCI_CONTINUE = -24200 OCI_ROWCBK_DONE = -24201 )
http://docs.oracle.com/cd/E11882_01/appdev.112/e10646/oci02bas.htm#LNOCI16220
const ( OCI_ONE_PIECE = 0 OCI_FIRST_PIECE = 1 OCI_NEXT_PIECE = 2 OCI_LAST_PIECE = 3 )
const ( SQLCS_IMPLICIT = 1 SQLCS_NCHAR = 2 SQLCS_EXPLICIT = 3 SQLCS_FLEXIBLE = 4 SQLCS_LIT_NULL = 5 )
const ( OCI_LOB_READONLY = 1 OCI_LOB_READWRITE = 2 OCI_LOB_WRITEONLY = 3 OCI_LOB_APPENDONLY = 4 OCI_LOB_FULLOVERWRITE = 5 OCI_LOB_FULLREAD = 6 )
const (
OCI_ATTR_NUM_DML_ERRORS = 73
)
const (
OCI_DEFAULT = 0
)
const (
OCI_NTV_SYNTAX = 1
)
Variables ¶
var MaxLongSize = 100000
MaxLongSize is size of buffer allocated for long type, (TODO: can this be improved to dynamic allocation?)
var PrefetchRows = 1000
PrefetchRows is row count to prefetch
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
type Descriptor ¶
type Descriptor struct {
// contains filtered or unexported fields
}
Descriptor describes variable where to put query result http://web.stanford.edu/dept/itss/docs/oracle/10gR2/appdev.102/b14250/oci04sql.htm#sthref629
func (*Descriptor) Name ¶
func (descr *Descriptor) Name() string
func (*Descriptor) Type ¶
func (descr *Descriptor) Type() int
type Library ¶
type Library struct {
// contains filtered or unexported fields
}
Library handler
func (*Library) NewProc ¶
func (lib *Library) NewProc(name string) *LibraryProc
NewProc creates system call proc to passed functio from Library
type LibraryProc ¶
type LibraryProc struct {
// contains filtered or unexported fields
}
LibraryProc handler for single procedure from library
type Lob ¶
type Lob struct {
// contains filtered or unexported fields
}
Lob represents oracle lob handle
func (*Lob) OpenReader ¶
OpenReader creates reder for reading from oracle lob
type LobReader ¶
type LobReader struct { *Lob // contains filtered or unexported fields }
LobReader implements reader for oracle lob reading
type OraValueConverter ¶
type OraValueConverter struct {
// contains filtered or unexported fields
}
func (OraValueConverter) ConvertValue ¶
func (ovc OraValueConverter) ConvertValue(v interface{}) (driver.Value, error)
ConvertValue converts type
type QueryResult ¶
type QueryResult struct {
// contains filtered or unexported fields
}
QueryResult handles query result, it adds more functions for result than standart database/sql
func (*QueryResult) Close ¶
func (qr *QueryResult) Close() (err error)
func (*QueryResult) FieldDescriptions ¶
func (qr *QueryResult) FieldDescriptions() (fields []*Descriptor)
func (*QueryResult) Next ¶
func (qr *QueryResult) Next() error
Next fetchers next row in query result
func (*QueryResult) Scan ¶
func (qr *QueryResult) Scan(x ...interface{}) (err error)
func (*QueryResult) Values ¶
func (qr *QueryResult) Values() (row []interface{}, err error)
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result implements driver.Result interface
func (Result) LastInsertId ¶
LastInsertId returns last inserted id TODO: this is not implemented
func (Result) RowsAffected ¶
RowsAffected returns affected row count TODO: this is not implemented
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
Rows implements handling rowset result from database
type Statement ¶
type Statement struct {
// contains filtered or unexported fields
}
Statement handles single SQL statement
func (*Statement) ColumnConverter ¶
func (stmt *Statement) ColumnConverter(idx int) driver.ValueConverter
ColumnConverter converting specific value for sending value to database
func (*Statement) SetPrefrech ¶
SetPrefrech sets actual prefetch
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction handler
func (*Transaction) Commit ¶
func (tx *Transaction) Commit() error
Commit implements transaction commit
func (*Transaction) Rollback ¶
func (tx *Transaction) Rollback() error
Rollback implements transaction rollback