Documentation
¶
Index ¶
- Constants
- Variables
- func Copy(dest, src any) error
- func RCopy(dest reflect.Value, src any) (err error)
- type BFile
- func (file *BFile) Close() error
- func (file *BFile) CopyTo(dest driver.Value) error
- func (file *BFile) Exists() (bool, error)
- func (l *BFile) Free() error
- func (file *BFile) GetDirName() string
- func (file *BFile) GetFileName() string
- func (l *BFile) GetLength() (int64, error)
- func (l *BFile) GetLocator() Locator
- func (file *BFile) GetMaxLen() int64
- func (l *BFile) GetReadMode() configurations.LobReadMode
- func (l *BFile) GetStreamer() LobStreamer
- func (l *BFile) IsDataUploaded() bool
- func (file *BFile) IsInit() bool
- func (l *BFile) IsNil() bool
- func (file *BFile) IsOpen() bool
- func (l *BFile) IsQuasi() bool
- func (file *BFile) Open(ctx context.Context) error
- func (l *BFile) ReadBytesFromPos(ctx context.Context, pos, count int64) ([]byte, error)
- func (l *BFile) ReadFromPos(ctx context.Context, pos int64) ([]byte, error)
- func (file *BFile) Scan(input interface{}) error
- func (file *BFile) SetStreamer(input LobStreamer)
- func (file *BFile) SetValue(input interface{}) error
- func (file *BFile) Value() (interface{}, error)
- type Basic
- type Blob
- func (blob *Blob) CopyTo(dest driver.Value) error
- func (l *Blob) Free() error
- func (l *Blob) GetLength() (int64, error)
- func (l *Blob) GetLocator() Locator
- func (l *Blob) GetReadMode() configurations.LobReadMode
- func (l *Blob) GetStreamer() LobStreamer
- func (l *Blob) IsDataUploaded() bool
- func (l *Blob) IsNil() bool
- func (l *Blob) IsQuasi() bool
- func (blob *Blob) Read(ctx context.Context) error
- func (l *Blob) ReadBytesFromPos(ctx context.Context, pos, count int64) ([]byte, error)
- func (l *Blob) ReadFromPos(ctx context.Context, pos int64) ([]byte, error)
- func (blob *Blob) Scan(src interface{}) error
- func (l *Blob) SetStreamer(input LobStreamer)
- func (blob *Blob) SetValue(input interface{}) error
- func (blob *Blob) Upload() error
- type Bool
- type Clob
- func (clob *Clob) CopyTo(dest driver.Value) error
- func (l *Clob) Free() error
- func (l *Clob) GetLength() (int64, error)
- func (l *Clob) GetLocator() Locator
- func (l *Clob) GetReadMode() configurations.LobReadMode
- func (l *Clob) GetStreamer() LobStreamer
- func (l *Clob) IsDataUploaded() bool
- func (l *Clob) IsNil() bool
- func (l *Clob) IsQuasi() bool
- func (clob *Clob) Read(ctx context.Context) error
- func (l *Clob) ReadBytesFromPos(ctx context.Context, pos, count int64) ([]byte, error)
- func (l *Clob) ReadFromPos(ctx context.Context, pos int64) ([]byte, error)
- func (clob *Clob) Scan(value interface{}) error
- func (l *Clob) SetStreamer(input LobStreamer)
- func (clob *Clob) SetValue(input interface{}) error
- func (clob *Clob) Upload() error
- type Date
- type Interval
- type Json
- func (js *Json) CopyTo(dest driver.Value) error
- func (l *Json) Free() error
- func (l *Json) GetLength() (int64, error)
- func (js *Json) GetLocator() Locator
- func (l *Json) GetReadMode() configurations.LobReadMode
- func (l *Json) GetStreamer() LobStreamer
- func (l *Json) IsDataUploaded() bool
- func (l *Json) IsNil() bool
- func (l *Json) IsQuasi() bool
- func (js *Json) Read(ctx context.Context) error
- func (l *Json) ReadBytesFromPos(ctx context.Context, pos, count int64) ([]byte, error)
- func (l *Json) ReadFromPos(ctx context.Context, pos int64) ([]byte, error)
- func (js *Json) Scan(input interface{}) error
- func (l *Json) SetStreamer(input LobStreamer)
- func (js *Json) SetValue(input interface{}) error
- func (js *Json) Upload() error
- func (js *Json) Value() (interface{}, error)
- type JsonCoder
- type JsonDecoder
- type JsonEncoder
- type Lob
- type LobStreamer
- type Locator
- type Number
- func (number *Number) CopyTo(dest interface{}) error
- func (number *Number) Float64() (float64, error)
- func (number *Number) GetMaxLen() int64
- func (number *Number) Int64() (int64, error)
- func (number *Number) Scan(value interface{}) error
- func (number *Number) SetValue(input interface{}) error
- func (number *Number) String() (string, error)
- func (number *Number) Uint64() (uint64, error)
- func (number *Number) Value() (interface{}, error)
- type Object
- type OracleType
- type Raw
- type RowID
- type String
- type Vector
- func (vector *Vector) CopyTo(dest driver.Value) error
- func (l *Vector) Free() error
- func (l *Vector) GetLength() (int64, error)
- func (vector *Vector) GetLocator() Locator
- func (l *Vector) GetReadMode() configurations.LobReadMode
- func (l *Vector) GetStreamer() LobStreamer
- func (l *Vector) IsDataUploaded() bool
- func (l *Vector) IsNil() bool
- func (l *Vector) IsQuasi() bool
- func (vector *Vector) Read(ctx context.Context) error
- func (l *Vector) ReadBytesFromPos(ctx context.Context, pos, count int64) ([]byte, error)
- func (l *Vector) ReadFromPos(ctx context.Context, pos int64) ([]byte, error)
- func (vector *Vector) Scan(input interface{}) error
- func (l *Vector) SetStreamer(input LobStreamer)
- func (vector *Vector) SetValue(input interface{}) error
- func (vector *Vector) Upload() error
- func (vector *Vector) Value() (interface{}, error)
- type VectorDataType
- type VectorType
Constants ¶
View Source
const ( NCHAR uint16 = 1 NUMBER uint16 = 2 BInteger uint16 = 3 FLOAT uint16 = 4 NullStr uint16 = 5 VarNum uint16 = 6 PDN uint16 = 7 LONG uint16 = 8 VARCHAR uint16 = 9 ROWID uint16 = 11 DATE uint16 = 12 VarRaw uint16 = 15 BFLOAT uint16 = 21 BDOUBLE uint16 = 22 RAW uint16 = 23 LongRaw uint16 = 24 TNS_JSON_TYPE_DATE uint16 = 60 TNS_JSON_TYPE_INTERVAL_YM uint16 = 61 TNS_JSON_TYPE_INTERVAL_DS uint16 = 62 UINT uint16 = 68 LongVarChar uint16 = 94 LongVarRaw uint16 = 95 CHAR uint16 = 96 CHARZ uint16 = 97 IBFLOAT uint16 = 100 IBDOUBLE uint16 = 101 REFCURSOR uint16 = 102 OCIXMLType uint16 = 108 XMLType uint16 = 109 OCIRef uint16 = 110 OCIClobLocator uint16 = 112 OCIBlobLocator uint16 = 113 OCIFileLocator uint16 = 114 RESULTSET uint16 = 116 JSON uint16 = 119 TNS_DATA_TYPE_OAC122 uint16 = 120 VECTOR uint16 = 127 OCIString uint16 = 155 OCIDate uint16 = 156 TimeStampDTY uint16 = 180 TimeStampTZ_DTY uint16 = 181 INTERVALYM_DTY uint16 = 182 INTERVALDS_DTY uint16 = 183 TimeTZ uint16 = 186 TIMESTAMP uint16 = 187 TIMESTAMPTZ uint16 = 188 IntervalYM uint16 = 189 IntervalDS uint16 = 190 UROWID uint16 = 208 TimeStampLTZ_DTY uint16 = 231 TimeStampLTZ uint16 = 232 BOOLEAN uint16 = 0xFC )
import "github.com/sijms/go-ora/v3"
Variables ¶
View Source
var ( TyFloat64 = reflect.TypeOf((*float64)(nil)).Elem() TyFloat32 = reflect.TypeOf((*float32)(nil)).Elem() TyInt = reflect.TypeOf((*int)(nil)).Elem() TyInt8 = reflect.TypeOf((*int8)(nil)).Elem() TyInt16 = reflect.TypeOf((*int16)(nil)).Elem() TyInt32 = reflect.TypeOf((*int32)(nil)).Elem() TyInt64 = reflect.TypeOf((*int64)(nil)).Elem() TyUint = reflect.TypeOf((*uint)(nil)).Elem() TyUint8 = reflect.TypeOf((*uint8)(nil)).Elem() TyUint16 = reflect.TypeOf((*uint16)(nil)).Elem() TyUint32 = reflect.TypeOf((*uint32)(nil)).Elem() TyUint64 = reflect.TypeOf((*uint64)(nil)).Elem() TyBool = reflect.TypeOf((*bool)(nil)).Elem() TyBytes = reflect.TypeOf((*[]byte)(nil)).Elem() TyString = reflect.TypeOf((*string)(nil)).Elem() TyTime = reflect.TypeOf((*time.Time)(nil)).Elem() TyNullByte = reflect.TypeOf((*sql.NullByte)(nil)).Elem() TyNullInt16 = reflect.TypeOf((*sql.NullInt16)(nil)).Elem() TyNullInt32 = reflect.TypeOf((*sql.NullInt32)(nil)).Elem() TyNullInt64 = reflect.TypeOf((*sql.NullInt64)(nil)).Elem() TyNullFloat64 = reflect.TypeOf((*sql.NullFloat64)(nil)).Elem() TyNullBool = reflect.TypeOf((*sql.NullBool)(nil)).Elem() TyNullString = reflect.TypeOf((*sql.NullString)(nil)).Elem() TyNullTime = reflect.TypeOf((*sql.NullTime)(nil)).Elem() TyScanner = reflect.TypeOf((*sql.Scanner)(nil)).Elem() TyNumber = reflect.TypeOf((*Number)(nil)).Elem() TyBoolean = reflect.TypeOf((*Bool)(nil)).Elem() TyVarchar = reflect.TypeOf((*String)(nil)).Elem() TyDate = reflect.TypeOf((*Date)(nil)).Elem() TyInterval = reflect.TypeOf((*Interval)(nil)).Elem() TyRaw = reflect.TypeOf((*Raw)(nil)).Elem() TyVector = reflect.TypeOf((*Vector)(nil)).Elem() TyJson = reflect.TypeOf((*Json)(nil)).Elem() TyClob = reflect.TypeOf((*Clob)(nil)).Elem() TyBlob = reflect.TypeOf((*Blob)(nil)).Elem() TyBFile = reflect.TypeOf((*BFile)(nil)).Elem() TyObject = reflect.TypeOf((*Object)(nil)).Elem() )
Functions ¶
Types ¶
type BFile ¶
type BFile struct {
Basic
//dirName string
//fileName string
Conv converters.IStringConverter
// contains filtered or unexported fields
}
func (*BFile) GetDirName ¶
func (*BFile) GetFileName ¶
func (*BFile) GetLocator ¶
func (l *BFile) GetLocator() Locator
func (*BFile) GetReadMode ¶
func (l *BFile) GetReadMode() configurations.LobReadMode
func (*BFile) GetStreamer ¶
func (l *BFile) GetStreamer() LobStreamer
func (*BFile) IsDataUploaded ¶
func (l *BFile) IsDataUploaded() bool
func (*BFile) ReadBytesFromPos ¶
func (*BFile) ReadFromPos ¶
func (l *lobBase) Read(ctx context.Context) ([]byte, error) {
return l.ReadBytesFromPos(ctx, 0, 0)
}
func (*BFile) SetStreamer ¶
func (file *BFile) SetStreamer(input LobStreamer)
func (file *BFile) filePath() string {
if len(file.dirName) == 0 || len(file.fileName) == 0 {
return ""
}
return file.dirName + "/" + file.fileName
}
type Basic ¶
type Basic struct {
// contains filtered or unexported fields
}
func (*Basic) GetDataType ¶
func (*Basic) SetDataType ¶
type Blob ¶
func CreateBlob ¶
func NewBlob ¶
func NewBlob(stream LobStreamer, uploadCtx context.Context, input interface{}) (*Blob, error)
func (*Blob) GetLocator ¶
func (l *Blob) GetLocator() Locator
func (*Blob) GetReadMode ¶
func (l *Blob) GetReadMode() configurations.LobReadMode
func (*Blob) GetStreamer ¶
func (l *Blob) GetStreamer() LobStreamer
func (*Blob) IsDataUploaded ¶
func (l *Blob) IsDataUploaded() bool
func (*Blob) Read ¶
func (blob *Blob) createLocatorAndUploadData(ctx context.Context) error {
if l.stream == nil {
return errNilStreamer
}
var err error
if len(blob.bValue) == 0 {
return nil
}
done := blob.stream.StartContext(ctx)
defer blob.stream.EndContext(done)
_, err = blob.stream.CreateTemporaryLocator(0, 0)
if err != nil {
return err
}
err = blob.stream.Write(blob.bValue)
return err
}
func (*Blob) ReadBytesFromPos ¶
func (*Blob) ReadFromPos ¶
func (l *lobBase) Read(ctx context.Context) ([]byte, error) {
return l.ReadBytesFromPos(ctx, 0, 0)
}
func (*Blob) SetStreamer ¶
func (l *Blob) SetStreamer(input LobStreamer)
type Clob ¶
type Clob struct {
String
// contains filtered or unexported fields
}
func CreateClob ¶
func (*Clob) CopyTo ¶
func NewClob(streamer LobStreamer) *Clob {
ret := &Clob{}
ret.stream = streamer
return ret
}
func NewClob(streamer LobStreamer, charsetID, charsetForm int, data []byte) (Clob, error) {
ret := &clob{}
var err error
ret.stream = streamer
if ret.IsVarWidthChar() {
if ret.stream.DatabaseVersionNumber() < 10200 && ret.IsLittleEndian() {
ret.charsetConverter, err = streamer.GetStringCoder().GetStringCoder(2002, 0)
} else {
ret.charsetConverter, err = streamer.GetStringCoder().GetStringCoder(2000, 0)
}
} else {
ret.charsetConverter, err = streamer.GetStringCoder().GetStringCoder(charsetID, charsetForm)
}
if err != nil {
return nil, err
}
if len(data) == 0 {
ret.Valid = false
} else {
ret.Valid = true
ret.String = ret.charsetConverter.Decode(data)
}
return ret, nil
}
func (l *clob) Charset() (charsetID int, charsetForm int) {
return l.charsetID, l.charsetForm
}
func (*Clob) GetLocator ¶
func (l *Clob) GetLocator() Locator
func (*Clob) GetReadMode ¶
func (l *Clob) GetReadMode() configurations.LobReadMode
func (*Clob) GetStreamer ¶
func (l *Clob) GetStreamer() LobStreamer
func (*Clob) IsDataUploaded ¶
func (l *Clob) IsDataUploaded() bool
func (*Clob) ReadBytesFromPos ¶
func (*Clob) ReadFromPos ¶
func (l *lobBase) Read(ctx context.Context) ([]byte, error) {
return l.ReadBytesFromPos(ctx, 0, 0)
}
func (*Clob) SetStreamer ¶
func (l *Clob) SetStreamer(input LobStreamer)
type Date ¶
func NewTimeStamp ¶
func NewTimeStampTZ ¶
type Interval ¶
type Interval struct {
Basic
}
func NewDaySecondInterval ¶
func NewYearMonthInterval ¶
type Json ¶
func (*Json) GetLocator ¶
func (*Json) GetReadMode ¶
func (l *Json) GetReadMode() configurations.LobReadMode
func (*Json) GetStreamer ¶
func (l *Json) GetStreamer() LobStreamer
func (*Json) IsDataUploaded ¶
func (l *Json) IsDataUploaded() bool
func (*Json) ReadBytesFromPos ¶
func (*Json) ReadFromPos ¶
func (l *lobBase) Read(ctx context.Context) ([]byte, error) {
return l.ReadBytesFromPos(ctx, 0, 0)
}
func (*Json) SetStreamer ¶
func (l *Json) SetStreamer(input LobStreamer)
type JsonDecoder ¶
type JsonEncoder ¶
type LobStreamer ¶
type LobStreamer interface {
StartContext(ctx context.Context) chan struct{}
EndContext(done chan struct{})
GetLocator() Locator
SetLocator(locator Locator)
DatabaseVersionNumber() int
GetStringCoder() converters.StringCoder
GetLobStreamMode() configurations.LobFetch
GetLobReadMode() configurations.LobReadMode
GetTracer() trace.Tracer
GetSize() (int64, error)
Exists() (bool, error)
CreateTemporaryLocator(charsetID, charsetForm int) (Locator, error)
FreeTemporaryLocator() error
Open(mode, opID int) error
Read(offset, count int64) ([]byte, error)
Write(data []byte) error
Close(opID int) error
}
type Locator ¶
type Locator []byte
func NewQuasiLocator ¶
func (Locator) IsLittleEndian ¶
func (Locator) IsReadOnly ¶
func (Locator) IsTemporary ¶
func (Locator) IsValueBased ¶
func (Locator) IsVarWidthChar ¶
type OracleType ¶
type RowID ¶
type String ¶
type String struct {
Basic
Conv converters.IStringConverter
UseNCharset bool
}
type Vector ¶
type Vector struct {
Basic
// contains filtered or unexported fields
}
func CreateVector ¶
CreateVector : create vector from supported array type: uint8, float32 and float64
func (*Vector) GetLocator ¶
func (*Vector) GetReadMode ¶
func (l *Vector) GetReadMode() configurations.LobReadMode
func (*Vector) GetStreamer ¶
func (l *Vector) GetStreamer() LobStreamer
func (*Vector) IsDataUploaded ¶
func (l *Vector) IsDataUploaded() bool
func (*Vector) ReadBytesFromPos ¶
func (*Vector) ReadFromPos ¶
func (l *lobBase) Read(ctx context.Context) ([]byte, error) {
return l.ReadBytesFromPos(ctx, 0, 0)
}
func (*Vector) SetStreamer ¶
func (l *Vector) SetStreamer(input LobStreamer)
type VectorDataType ¶
type VectorDataType int
type VectorType ¶
type VectorType int
const ( VECTOR_SPARSE VectorType = iota VECTOR_DENSE )
const (
VECTOR_NIL VectorDataType = iota VECTOR_UINT8 VECTOR_FL32 VECTOR_FL64
)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.