Documentation
¶
Overview ¶
Copyright 2022, YashanDB and/or its affiliates. All rights reserved. YashanDB Driver for golang is licensed under the terms of the mulan PSL v2.0
License: http://license.coscl.org.cn/MulanPSL2 Home page: https://www.yashandb.com/
Copyright 2022, YashanDB and/or its affiliates. All rights reserved. YashanDB Driver for golang is licensed under the terms of the mulan PSL v2.0
License: http://license.coscl.org.cn/MulanPSL2 Home page: https://www.yashandb.com/
Index ¶
- Constants
- Variables
- func ConvertToNameValue(args ...any) ([]driver.NamedValue, error)
- func FormatTime(format string, t time.Time) string
- func FormatYMInterval(format string, year, month int32) string
- func GetDatabaseTypeName(yapiType uint32) string
- func GetDatabaseTypeSize(yType C.YapiType) int32
- func NewOutputBindValue(dest interface{}, opts ...outputBindOpt) (*outputBindInfo, error)
- func NewYasRow(size uint32, yacType C.YapiType, precision uint8, scale int8, nullable uint8) *yasRow
- func PbdgGetBindOutValue(stmt *YasStmt) error
- func PdbgAbort(stmt *YasStmt) error
- func PdbgAddBreakpoint(stmt *YasStmt, objId uint64, subId uint16, lineNo uint32) (uint32, error)
- func PdbgCheckVersion(stmt *YasStmt, objId uint64, subId uint16, version uint32) error
- func PdbgContinue(stmt *YasStmt) error
- func PdbgDeleteAllBreakpoints(stmt *YasStmt) error
- func PdbgDeleteBreakpoint(stmt *YasStmt, objId uint64, subId uint16, lineNo uint32) error
- func PdbgGetAllFrames(stmt *YasStmt) (uint32, error)
- func PdbgGetAllVars(stmt *YasStmt) (uint32, error)
- func PdbgGetBreakpointAttrs(stmt *YasStmt, id uint32, attr DebugBpAttr, value interface{}) error
- func PdbgGetBreakpointsCount(stmt *YasStmt) (uint32, error)
- func PdbgGetFrameAttrs(stmt *YasStmt, id uint32, attr DebugFrameAttr, value interface{}) error
- func PdbgGetRunningAttrs(stmt *YasStmt, attr DebugRunningAttr, value interface{}) error
- func PdbgGetVarAttrs(stmt *YasStmt, id uint32, attr DebugVarAttr, value interface{}) error
- func PdbgGetVarValue(stmt *YasStmt, id uint32) (string, error)
- func PdbgStart(stmt *YasStmt, objId uint64, subId uint16) error
- func PdbgStatementClose(stmt *YasStmt) error
- func PdbgStepInto(stmt *YasStmt) error
- func PdbgStepNext(stmt *YasStmt) error
- func PdbgStepOut(stmt *YasStmt) error
- func SetClientDriverName(name string)
- func SetDebugMode()
- func WithBindSize(bindSize uint32) outputBindOpt
- func WithCursor() outputBindOpt
- func WithTypeBigInt() outputBindOpt
- func WithTypeBit() outputBindOpt
- func WithTypeBlob() outputBindOpt
- func WithTypeBool() outputBindOpt
- func WithTypeChar() outputBindOpt
- func WithTypeClob() outputBindOpt
- func WithTypeCursor() outputBindOpt
- func WithTypeDSInterval() outputBindOpt
- func WithTypeDate() outputBindOpt
- func WithTypeDouble() outputBindOpt
- func WithTypeFloat() outputBindOpt
- func WithTypeInteger() outputBindOpt
- func WithTypeNumber() outputBindOpt
- func WithTypeNvarchar() outputBindOpt
- func WithTypeRaw() outputBindOpt
- func WithTypeRowid() outputBindOpt
- func WithTypeSmallInt() outputBindOpt
- func WithTypeTimestamp() outputBindOpt
- func WithTypeTimestampLocalTimeZone() outputBindOpt
- func WithTypeTimestampTimeZone() outputBindOpt
- func WithTypeTinyint() outputBindOpt
- func WithTypeVarchar() outputBindOpt
- func WithTypeVector() outputBindOpt
- func WithTypeYMInterval() outputBindOpt
- type BindOutDestTypeErr
- type CompatVector
- type DSInterval
- type DTF
- type DataSourceName
- type DebugBpAttr
- type DebugConfigOpt
- type DebugFrameAttr
- type DebugRunningAttr
- type DebugVarAttr
- type DebuggerStatus
- type Number
- func (n Number) Float64() (float64, error)
- func (n Number) Int64() (int64, error)
- func (n Number) IsNull() bool
- func (n Number) MarshalJSON() ([]byte, error)
- func (n Number) MarshalText() ([]byte, error)
- func (n *Number) Scan(src interface{}) error
- func (n Number) String() string
- func (n Number) Text() (string, bool)
- func (n *Number) UnmarshalJSON(data []byte) error
- func (n *Number) UnmarshalText(text []byte) error
- func (n Number) Valid() bool
- func (n Number) Value() (driver.Value, error)
- type PdbgBreakpointAttr
- type PdbgFrameData
- type PdbgRunningAttr
- type PdbgVarAttr
- type PlsqlDebug
- func (p *PlsqlDebug) Abort() error
- func (p *PlsqlDebug) AddBreakpoint(objId uint64, subId uint16, lineNo uint32) (uint32, error)
- func (p *PlsqlDebug) CheckVersion(objId uint64, subId uint16, version uint32) error
- func (p *PlsqlDebug) Close() error
- func (p *PlsqlDebug) CloseWithoutConn() error
- func (p *PlsqlDebug) Continue() error
- func (p *PlsqlDebug) DeleteAllBreakpoint() error
- func (p *PlsqlDebug) DeleteBreakpoint(objId uint64, subId uint16, lineNo uint32) error
- func (p *PlsqlDebug) GetAllBreakpointAttrs() ([]*PdbgBreakpointAttr, error)
- func (p *PlsqlDebug) GetAllFrameAttrs() ([]*PdbgFrameData, error)
- func (p *PlsqlDebug) GetAllFrames() (uint32, error)
- func (p *PlsqlDebug) GetAllRunningAttrs() (*PdbgRunningAttr, error)
- func (p *PlsqlDebug) GetAllVarAttrs() ([]*PdbgVarAttr, error)
- func (p *PlsqlDebug) GetAllVars() (uint32, error)
- func (p *PlsqlDebug) GetBindOutValue() error
- func (p *PlsqlDebug) GetBreakpointAttrs(id uint32, attr DebugBpAttr, value interface{}) error
- func (p *PlsqlDebug) GetBreakpointsCount() (uint32, error)
- func (p *PlsqlDebug) GetFrameAttrs(id uint32, attr DebugFrameAttr, value interface{}) error
- func (p *PlsqlDebug) GetOutput() ([]string, error)
- func (p *PlsqlDebug) GetRunningAttrs(attr DebugRunningAttr, value interface{}) error
- func (p *PlsqlDebug) GetVarAttrs(id uint32, attr DebugVarAttr, value interface{}) error
- func (p *PlsqlDebug) GetVarValue(id uint32) (string, error)
- func (p *PlsqlDebug) PdbgGetOutput() (string, error)
- func (p *PlsqlDebug) Start(objId uint64, subId uint16) error
- func (p *PlsqlDebug) StepInto() error
- func (p *PlsqlDebug) StepNext() error
- func (p *PlsqlDebug) StepOut() error
- type Vector
- type VectorFormat
- type VectorScanError
- type YMInterval
- type YasBaseError
- func ErrDataPathNoExist(p string) *YasBaseError
- func ErrDbFetchEOF() *YasBaseError
- func ErrDbTypeUnsupport(dbType int) *YasBaseError
- func ErrDsnNoSet() *YasBaseError
- func ErrDsnNoStandard(dsn string) *YasBaseError
- func ErrEnvInit() *YasBaseError
- func ErrNoConnect() *YasBaseError
- func ErrNoCursorHandle() *YasBaseError
- func ErrOutputBindValue() *YasBaseError
- func ErrStmtInit() *YasBaseError
- func ErrStmtNoOpen() *YasBaseError
- func ErrUnknowType(v interface{}) *YasBaseError
- func ErrVectorNil() *YasBaseError
- type YasConn
- func (conn *YasConn) Begin() (driver.Tx, error)
- func (conn *YasConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)
- func (conn *YasConn) Cancel() error
- func (conn *YasConn) Close() error
- func (conn *YasConn) Ping(ctx context.Context) error
- func (conn *YasConn) Prepare(query string) (driver.Stmt, error)
- func (conn *YasConn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- func (conn *YasConn) ResetSession(ctx context.Context) error
- type YasConnector
- type YasDBError
- type YasResult
- type YasRows
- func (r *YasRows) Close() error
- func (r *YasRows) ColumnTypeDatabaseTypeName(index int) string
- func (r *YasRows) ColumnTypeLength(index int) (length int64, ok bool)
- func (r *YasRows) ColumnTypeNullable(index int) (nullable, ok bool)
- func (r *YasRows) ColumnTypePrecisionScale(index int) (precision, scale int64, ok bool)
- func (r *YasRows) ColumnTypeScanType(index int) reflect.Type
- func (r *YasRows) Columns() []string
- func (r *YasRows) Next(dest []driver.Value) error
- type YasStmt
- func (stmt *YasStmt) CheckNamedValue(namedValue *driver.NamedValue) error
- func (stmt *YasStmt) Close() error
- func (stmt *YasStmt) Exec(args []driver.Value) (driver.Result, error)deprecated
- func (stmt *YasStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
- func (stmt *YasStmt) NumInput() int
- func (stmt *YasStmt) Query(args []driver.Value) (driver.Rows, error)deprecated
- func (stmt *YasStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
- type YasTx
- type YasdbDriver
Constants ¶
const ( SS_UNKNOWN serverStatus = 255 SS_UNCONNECTED serverStatus = 0 SS_NORMAL serverStatus = 1 )
const ( DBG_RUNNING_ATTR_STATUS DebugRunningAttr = 0 DBG_RUNNING_ATTR_OBJ_ID DebugRunningAttr = 1 DBG_RUNNING_ATTR_SUB_ID DebugRunningAttr = 2 DBG_RUNNING_ATTR_LINE_NO DebugRunningAttr = 3 DBG_RUNNING_ATTR_CLASS_NAME DebugRunningAttr = 4 DBG_RUNNING_ATTR_METHOD_NAME DebugRunningAttr = 5 DBG_FRAME_ATTR_OBJ_ID DebugFrameAttr = 0 DBG_FRAME_ATTR_SUB_ID DebugFrameAttr = 1 DBG_FRAME_ATTR_LINE_NO DebugFrameAttr = 2 DBG_FRAME_ATTR_STACK_NO DebugFrameAttr = 3 DBG_FRAME_ATTR_CLASS_NAME DebugFrameAttr = 4 DBG_FRAME_ATTR_METHOD_NAME DebugFrameAttr = 5 DBG_VAR_ATTR_BLOCK_NO DebugVarAttr = 0 DBG_VAR_ATTR_TYPE DebugVarAttr = 1 DBG_VAR_ATTR_IS_GLOBAL DebugVarAttr = 2 DBG_VAR_ATTR_NAME DebugVarAttr = 3 DBG_VAR_ATTR_VALUE_SIZE DebugVarAttr = 4 DBG_BP_ATTR_OBJ_ID DebugBpAttr = 0 DBG_BP_ATTR_SUB_ID DebugBpAttr = 1 DBG_BP_ATTR_LINE_NO DebugBpAttr = 2 DBG_STATUS_OFF DebuggerStatus = 0 DBG_STATUS_ON DebuggerStatus = 1 DEFAULT_ATTRS_BUFFER = 68*2 + 1 )
const PdbgOutputDefaultBufSize = 65534*2 + 1
Variables ¶
var ( CST_UNKNOW cliSqlType = 0 CST_SELECT cliSqlType = 1 CST_INSERT cliSqlType = 2 CST_UPDATE cliSqlType = 3 CST_DELETE cliSqlType = 4 CST_PLSQL cliSqlType = 126 )
var ( ValueTypeUint64Err = errors.New("the value parameter type must be *uint64") ValueTypeUint16Err = errors.New("the value parameter type must be *uint16") ValueTypeUint32Err = errors.New("the value parameter type must be *uint32") ValueTypeStringErr = errors.New("the value parameter type must be *string") )
var DateTimeFormats = map[DTF]string{ DateTimeMicroZone: "2006-01-02 15:04:05.999999 -07:00", DateTimeZone: "2006-01-02 15:04:05 -07:00", DateTimeMicro: "2006-01-02 15:04:05.999999", DateTime: "2006-01-02 15:04:05", Date: "2006-01-02", TimeMicro: "15:04:05.999999", Time: "15:04:05", }
DateTimeFormats holds all datetime format strings
var ErrInsertIdUnsupport = errors.New("last insert id is unsupport")
Functions ¶
func ConvertToNameValue ¶
func ConvertToNameValue(args ...any) ([]driver.NamedValue, error)
func FormatTime ¶
取值范围/格式:[0001-01-01 00:00:00.000000,9999-12-31 23:59:59.999999],[-15:59~+15:59],支持的格式符:'YYYY'/'YYY'/'YY'/'Y'/'MM'/'MON'/'MONTH'/'DD'/'D'/'DAY'/'HH'/'HH12'/'HH24'/'MI'/'SS'/'AM'/'A.M.'/'PM'/'P.M.'/'FF'/'FF1'/'FF2'/'FF3'/'FF4'/'FF5'/'FF6'/'FF7'/'FF8'/'FF9'/'TZH'/'TZM'
func FormatYMInterval ¶
func GetDatabaseTypeName ¶
func GetDatabaseTypeSize ¶
func NewOutputBindValue ¶
func NewOutputBindValue(dest interface{}, opts ...outputBindOpt) (*outputBindInfo, error)
func PbdgGetBindOutValue ¶
func PdbgAddBreakpoint ¶
func PdbgCheckVersion ¶
func PdbgContinue ¶
func PdbgDeleteBreakpoint ¶
func PdbgGetAllFrames ¶
func PdbgGetAllVars ¶
func PdbgGetBreakpointAttrs ¶
func PdbgGetBreakpointAttrs(stmt *YasStmt, id uint32, attr DebugBpAttr, value interface{}) error
func PdbgGetBreakpointsCount ¶
func PdbgGetFrameAttrs ¶
func PdbgGetFrameAttrs(stmt *YasStmt, id uint32, attr DebugFrameAttr, value interface{}) error
func PdbgGetRunningAttrs ¶
func PdbgGetRunningAttrs(stmt *YasStmt, attr DebugRunningAttr, value interface{}) error
func PdbgGetVarAttrs ¶
func PdbgGetVarAttrs(stmt *YasStmt, id uint32, attr DebugVarAttr, value interface{}) error
func PdbgStatementClose ¶
func PdbgStepInto ¶
func PdbgStepNext ¶
func PdbgStepOut ¶
func SetClientDriverName ¶
func SetClientDriverName(name string)
func SetDebugMode ¶
func SetDebugMode()
func WithBindSize ¶
func WithBindSize(bindSize uint32) outputBindOpt
func WithCursor ¶ added in v1.4.4
func WithCursor() outputBindOpt
func WithTypeBigInt ¶
func WithTypeBigInt() outputBindOpt
func WithTypeBit ¶
func WithTypeBit() outputBindOpt
func WithTypeBlob ¶
func WithTypeBlob() outputBindOpt
func WithTypeBool ¶
func WithTypeBool() outputBindOpt
func WithTypeChar ¶
func WithTypeChar() outputBindOpt
func WithTypeClob ¶
func WithTypeClob() outputBindOpt
func WithTypeCursor ¶ added in v1.4.4
func WithTypeCursor() outputBindOpt
func WithTypeDSInterval ¶
func WithTypeDSInterval() outputBindOpt
func WithTypeDate ¶
func WithTypeDate() outputBindOpt
func WithTypeDouble ¶
func WithTypeDouble() outputBindOpt
func WithTypeFloat ¶
func WithTypeFloat() outputBindOpt
func WithTypeInteger ¶
func WithTypeInteger() outputBindOpt
func WithTypeNumber ¶
func WithTypeNumber() outputBindOpt
func WithTypeNvarchar ¶
func WithTypeNvarchar() outputBindOpt
func WithTypeRaw ¶
func WithTypeRaw() outputBindOpt
func WithTypeRowid ¶
func WithTypeRowid() outputBindOpt
func WithTypeSmallInt ¶
func WithTypeSmallInt() outputBindOpt
func WithTypeTimestamp ¶
func WithTypeTimestamp() outputBindOpt
func WithTypeTimestampLocalTimeZone ¶
func WithTypeTimestampLocalTimeZone() outputBindOpt
func WithTypeTimestampTimeZone ¶
func WithTypeTimestampTimeZone() outputBindOpt
func WithTypeTinyint ¶
func WithTypeTinyint() outputBindOpt
func WithTypeVarchar ¶
func WithTypeVarchar() outputBindOpt
func WithTypeVector ¶ added in v1.4.4
func WithTypeVector() outputBindOpt
func WithTypeYMInterval ¶
func WithTypeYMInterval() outputBindOpt
Types ¶
type BindOutDestTypeErr ¶
type BindOutDestTypeErr struct {
TypeFormat string
}
func NewBindOutDestTypeErr ¶
func NewBindOutDestTypeErr(typeFormat string) *BindOutDestTypeErr
func (*BindOutDestTypeErr) Error ¶
func (d *BindOutDestTypeErr) Error() string
type CompatVector ¶ added in v1.4.4
type CompatVector string
const ( CV_NULL CompatVector = "null" CV_YASHAN CompatVector = "yashan" CV_MYSQL CompatVector = "mysql" )
type DSInterval ¶ added in v1.4.4
type DSInterval struct {
Day int32
DayTime time.Time // 只取time中的hour,minute,second,Nanosecond(实际上只到微妙)
}
func NewDSInterval ¶ added in v1.4.4
func NewDSInterval(day int32, dayTime time.Time) DSInterval
type DataSourceName ¶
type DataSourceName struct {
User string
Password string
Url string
DataPath string
IsAutoCommit bool
// contains filtered or unexported fields
}
func ParseDSN ¶
func ParseDSN(dsnStr string) (*DataSourceName, error)
ParseDSN parses a DataSourceName used to connect to YashanDB
It expects to receive a string in the form:
[username/[password]@]host[:port][?param1=value1&...¶mN=valueN] OR YASDB_DATA_PATH[?param1=value1&...¶mN=valueN] Supported parameters are:
autocommit - When it is true, the transaction will be automatically committed every time an SQL statement is executed. Default is false
type DebugBpAttr ¶
type DebugBpAttr int8
type DebugConfigOpt ¶ added in v1.4.4
type DebugConfigOpt func(*debugConfig)
func WithDebugCallTempalate ¶ added in v1.4.4
func WithDebugCallTempalate(call string, args ...any) DebugConfigOpt
func WithDebugEnableOutput ¶ added in v1.4.4
func WithDebugEnableOutput() DebugConfigOpt
func WithDebugOutputCacheSize ¶ added in v1.4.4
func WithDebugOutputCacheSize(cacheSize uint32) DebugConfigOpt
func WithDebugOutputMaxLineLen ¶ added in v1.4.4
func WithDebugOutputMaxLineLen(maxLineLen uint32) DebugConfigOpt
type DebugFrameAttr ¶
type DebugFrameAttr int8
type DebugRunningAttr ¶
type DebugRunningAttr int8
type DebugVarAttr ¶
type DebugVarAttr int8
type DebuggerStatus ¶
type DebuggerStatus int8
type Number ¶ added in v1.4.4
type Number struct {
// contains filtered or unexported fields
}
Number 是 YashanDB NUMBER 类型的无损文本包装。 零值 Number{} 表示 NULL。
func (Number) MarshalJSON ¶ added in v1.4.4
MarshalJSON 实现 json.Marshaler。NULL 序列化为 null,有效值序列化为 JSON 字符串(如 "123.45"),避免 JSON 数字消费者丢失精度。
func (Number) MarshalText ¶ added in v1.4.4
MarshalText 实现 encoding.TextMarshaler。NULL 时返回 nil。
func (*Number) Scan ¶ added in v1.4.4
Scan 实现 sql.Scanner,从数据库或 Go 值中读取 NUMBER。 支持的源类型:nil、string、[]byte、Number、*Number、int64、int、int32、float64、float32。
func (*Number) UnmarshalJSON ¶ added in v1.4.4
UnmarshalJSON 实现 json.Unmarshaler。支持 null、JSON 字符串和 JSON 数字。
func (*Number) UnmarshalText ¶ added in v1.4.4
UnmarshalText 实现 encoding.TextUnmarshaler。
type PdbgBreakpointAttr ¶
func PdbgGetAllBreakpointAttrs ¶
func PdbgGetAllBreakpointAttrs(stmt *YasStmt) ([]*PdbgBreakpointAttr, error)
type PdbgFrameData ¶
type PdbgFrameData struct {
Id uint32
ObjId uint64
SubId uint16
LineNo uint32
StackNo uint32
ClassName string
MethodName string
}
func PdbgGetAllFrameAttrs ¶
func PdbgGetAllFrameAttrs(stmt *YasStmt) ([]*PdbgFrameData, error)
type PdbgRunningAttr ¶
type PdbgRunningAttr struct {
Status DebuggerStatus
ObjId uint64
SubId uint16
LineNo uint32
ClassName string
MethodName string
}
func PdbgGetAllRunningAttrs ¶
func PdbgGetAllRunningAttrs(stmt *YasStmt) (*PdbgRunningAttr, error)
type PdbgVarAttr ¶
type PdbgVarAttr struct {
Id uint32
BlockNo uint32
DataType uint8
DataTypeName string
GlobalLevel uint8
Name string
Size uint32
Value string
}
func PdbgGetAllVarAttrs ¶
func PdbgGetAllVarAttrs(stmt *YasStmt) ([]*PdbgVarAttr, error)
type PlsqlDebug ¶
type PlsqlDebug struct {
Stmt *YasStmt
// contains filtered or unexported fields
}
func NewPlsqlDebug ¶
func NewPlsqlDebug(dsn string, opts ...DebugConfigOpt) (*PlsqlDebug, error)
NewPlsqlDebug 创建新的连接并初始化 PlsqlDebug(原有签名不变)。
func NewPlsqlDebugWithConn ¶ added in v1.4.4
func NewPlsqlDebugWithConn(conn *YasConn, opts ...DebugConfigOpt) (*PlsqlDebug, error)
NewPlsqlDebugWithConn 复用已有连接创建 PlsqlDebug。 调用方持有 conn 的所有权 — Close() 会关闭 conn; 用 CloseWithoutConn() 释放 PDBG 资源但保留共享连接。
func (*PlsqlDebug) Abort ¶
func (p *PlsqlDebug) Abort() error
func (*PlsqlDebug) AddBreakpoint ¶
func (*PlsqlDebug) CheckVersion ¶
func (p *PlsqlDebug) CheckVersion(objId uint64, subId uint16, version uint32) error
func (*PlsqlDebug) CloseWithoutConn ¶ added in v1.4.4
func (p *PlsqlDebug) CloseWithoutConn() error
CloseWithoutConn 关闭所有语句但保留底层连接。 用于共享连接场景:释放 PDBG 资源但不关闭 YasConn。
func (*PlsqlDebug) Continue ¶
func (p *PlsqlDebug) Continue() error
func (*PlsqlDebug) DeleteAllBreakpoint ¶
func (p *PlsqlDebug) DeleteAllBreakpoint() error
func (*PlsqlDebug) DeleteBreakpoint ¶
func (p *PlsqlDebug) DeleteBreakpoint(objId uint64, subId uint16, lineNo uint32) error
func (*PlsqlDebug) GetAllBreakpointAttrs ¶
func (p *PlsqlDebug) GetAllBreakpointAttrs() ([]*PdbgBreakpointAttr, error)
func (*PlsqlDebug) GetAllFrameAttrs ¶
func (p *PlsqlDebug) GetAllFrameAttrs() ([]*PdbgFrameData, error)
func (*PlsqlDebug) GetAllFrames ¶
func (p *PlsqlDebug) GetAllFrames() (uint32, error)
func (*PlsqlDebug) GetAllRunningAttrs ¶
func (p *PlsqlDebug) GetAllRunningAttrs() (*PdbgRunningAttr, error)
func (*PlsqlDebug) GetAllVarAttrs ¶
func (p *PlsqlDebug) GetAllVarAttrs() ([]*PdbgVarAttr, error)
func (*PlsqlDebug) GetAllVars ¶
func (p *PlsqlDebug) GetAllVars() (uint32, error)
func (*PlsqlDebug) GetBindOutValue ¶
func (p *PlsqlDebug) GetBindOutValue() error
func (*PlsqlDebug) GetBreakpointAttrs ¶
func (p *PlsqlDebug) GetBreakpointAttrs(id uint32, attr DebugBpAttr, value interface{}) error
func (*PlsqlDebug) GetBreakpointsCount ¶
func (p *PlsqlDebug) GetBreakpointsCount() (uint32, error)
func (*PlsqlDebug) GetFrameAttrs ¶
func (p *PlsqlDebug) GetFrameAttrs(id uint32, attr DebugFrameAttr, value interface{}) error
func (*PlsqlDebug) GetOutput ¶ added in v1.4.4
func (p *PlsqlDebug) GetOutput() ([]string, error)
func (*PlsqlDebug) GetRunningAttrs ¶
func (p *PlsqlDebug) GetRunningAttrs(attr DebugRunningAttr, value interface{}) error
func (*PlsqlDebug) GetVarAttrs ¶
func (p *PlsqlDebug) GetVarAttrs(id uint32, attr DebugVarAttr, value interface{}) error
func (*PlsqlDebug) GetVarValue ¶
func (p *PlsqlDebug) GetVarValue(id uint32) (string, error)
func (*PlsqlDebug) PdbgGetOutput ¶ added in v1.4.4
func (p *PlsqlDebug) PdbgGetOutput() (string, error)
func (*PlsqlDebug) StepInto ¶
func (p *PlsqlDebug) StepInto() error
func (*PlsqlDebug) StepNext ¶
func (p *PlsqlDebug) StepNext() error
func (*PlsqlDebug) StepOut ¶
func (p *PlsqlDebug) StepOut() error
type Vector ¶ added in v1.4.4
type Vector struct {
Data interface{} // []float32, []float64, 或 []int8
Dim uint16 // 向量维度
Format VectorFormat // 格式类型
}
Vector 向量数据类型
type VectorFormat ¶ added in v1.4.4
type VectorFormat uint8
VectorFormat 向量格式枚举
const ( VectorFormatFlex VectorFormat = 0 // 灵活格式 VectorFormatFloat16 VectorFormat = 1 // 半精度浮点 VectorFormatFloat32 VectorFormat = 2 // 单精度浮点 VectorFormatFloat64 VectorFormat = 3 // 双精度浮点 VectorFormatInt8 VectorFormat = 4 // 8位整数 )
type VectorScanError ¶ added in v1.4.4
type VectorScanError struct {
Type string
}
func (*VectorScanError) Error ¶ added in v1.4.4
func (e *VectorScanError) Error() string
type YMInterval ¶ added in v1.4.4
func NewYMInterval ¶ added in v1.4.4
func NewYMInterval(year int32, month int32) YMInterval
type YasBaseError ¶
func ErrDataPathNoExist ¶
func ErrDataPathNoExist(p string) *YasBaseError
func ErrDbFetchEOF ¶
func ErrDbFetchEOF() *YasBaseError
func ErrDbTypeUnsupport ¶
func ErrDbTypeUnsupport(dbType int) *YasBaseError
func ErrDsnNoSet ¶
func ErrDsnNoSet() *YasBaseError
func ErrDsnNoStandard ¶
func ErrDsnNoStandard(dsn string) *YasBaseError
func ErrEnvInit ¶
func ErrEnvInit() *YasBaseError
func ErrNoConnect ¶
func ErrNoConnect() *YasBaseError
func ErrNoCursorHandle ¶ added in v1.4.4
func ErrNoCursorHandle() *YasBaseError
func ErrOutputBindValue ¶
func ErrOutputBindValue() *YasBaseError
func ErrStmtInit ¶
func ErrStmtInit() *YasBaseError
func ErrStmtNoOpen ¶
func ErrStmtNoOpen() *YasBaseError
func ErrUnknowType ¶
func ErrUnknowType(v interface{}) *YasBaseError
func ErrVectorNil ¶ added in v1.4.4
func ErrVectorNil() *YasBaseError
func (*YasBaseError) Error ¶
func (e *YasBaseError) Error() string
type YasConn ¶
type YasConn struct {
Env *C.YapiEnv
Conn *C.YapiConnect
// contains filtered or unexported fields
}
func GenYasconn ¶
func (*YasConn) PrepareContext ¶
type YasConnector ¶
type YasConnector struct {
}
func (*YasConnector) Driver ¶
func (connector *YasConnector) Driver() driver.Driver
Driver returns the underlying Driver of the Connector, mainly to maintain compatibility with the Driver method on sql.DB.
type YasDBError ¶
func (*YasDBError) Error ¶
func (e *YasDBError) Error() string
type YasResult ¶
type YasResult struct {
// contains filtered or unexported fields
}
func (*YasResult) LastInsertId ¶
LastInsertId returns the database's auto-generated ID after, for example, an INSERT into a table with primary key.
func (*YasResult) RowsAffected ¶
RowsAffected returns the number of rows affected by the query.
type YasRows ¶
type YasRows struct {
// contains filtered or unexported fields
}
func (*YasRows) ColumnTypeDatabaseTypeName ¶
RowsColumnTypeDatabaseTypeName return the database system type name without the length. Type names should be uppercase.
func (*YasRows) ColumnTypeLength ¶
RowsColumnTypeLength return the length of the column type if the column is a variable length type. If the column is not a variable length type ok should return false. If length is not limited other than system limits, it should return math.MaxInt64.
func (*YasRows) ColumnTypeNullable ¶
func (*YasRows) ColumnTypePrecisionScale ¶
func (*YasRows) ColumnTypeScanType ¶
ColumnTypeScanType return the value type that can be used to scan types into. For example, the database column type "bigint" this should return "reflect.TypeOf(int64(0))".
func (*YasRows) Next ¶
Next is called to populate the next row of data into the provided slice. The provided slice will be the same size as the Columns() are wide.
Next should return io.EOF when there are no more rows.
The dest should not be written to outside of Next. Care should be taken when closing Rows not to modify a buffer held in dest.
type YasStmt ¶
type YasStmt struct {
Conn *YasConn
Stmt *C.YapiStmt
SqlType uint32
Sqlstr string
sync.Mutex
// contains filtered or unexported fields
}
func PrepareContext ¶
func (*YasStmt) CheckNamedValue ¶
func (stmt *YasStmt) CheckNamedValue(namedValue *driver.NamedValue) error
CheckNamedValue is called before passing arguments to the driver and is called in place of any ColumnConverter. CheckNamedValue must do type validation and conversion as appropriate for the driver.
func (*YasStmt) ExecContext ¶
func (stmt *YasStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)
ExecContext executes a query that doesn't return rows, such as an INSERT or UPDATE.
ExecContext must honor the context timeout and return when it is canceled.
func (*YasStmt) QueryContext ¶
func (stmt *YasStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)
QueryContext executes a query that may return rows, such as a SELECT.
QueryContext must honor the context timeout and return when it is canceled.
type YasdbDriver ¶
type YasdbDriver struct {
// contains filtered or unexported fields
}
func (*YasdbDriver) Conn ¶
func (yasDriver *YasdbDriver) Conn() *YasConn