Documentation
¶
Index ¶
- func JoinSlice(list any) string
- func StrNotEmpty(s string) bool
- type DS
- type DataSet
- func (ds *DataSet) AddContext(ctx context.Context) *DataSet
- func (ds *DataSet) AddSql(sql string) *DataSet
- func (ds *DataSet) Bof() bool
- func (ds *DataSet) ClearParams()
- func (ds *DataSet) Close()
- func (ds *DataSet) Count() int
- func (ds *DataSet) CreateFields() error
- func (ds *DataSet) Delete() (int64, error)
- func (ds *DataSet) DeleteContext(ctx context.Context) (int64, error)
- func (ds *DataSet) Eof() bool
- func (ds *DataSet) Exec() (sql.Result, error)
- func (ds *DataSet) ExecBatch(size int) error
- func (ds *DataSet) ExecContext(context context.Context) (sql.Result, error)
- func (ds *DataSet) FieldByName(fieldName string) *Field
- func (ds *DataSet) First()
- func (ds *DataSet) Free()
- func (ds *DataSet) GetAny(fieldName string) any
- func (ds *DataSet) GetBool(fieldName string) bool
- func (ds *DataSet) GetBoolNil(fieldName string) *bool
- func (ds *DataSet) GetByte(fieldName string) []byte
- func (ds *DataSet) GetByteNil(fieldName string) *[]byte
- func (ds *DataSet) GetDateTime(fieldName string) time.Time
- func (ds *DataSet) GetDateTimeNil(fieldName string) *time.Time
- func (ds *DataSet) GetFloat(fieldName string) float32
- func (ds *DataSet) GetFloat64(fieldName string) float64
- func (ds *DataSet) GetFloat64Nil(fieldName string) *float64
- func (ds *DataSet) GetFloatNil(fieldName string) *float32
- func (ds *DataSet) GetInt(fieldName string) int
- func (ds *DataSet) GetInt8(fieldName string) int8
- func (ds *DataSet) GetInt8Nil(fieldName string) *int8
- func (ds *DataSet) GetInt16(fieldName string) int16
- func (ds *DataSet) GetInt16Nil(fieldName string) *int16
- func (ds *DataSet) GetInt32(fieldName string) int32
- func (ds *DataSet) GetInt32Nil(fieldName string) *int32
- func (ds *DataSet) GetInt64(fieldName string) int64
- func (ds *DataSet) GetInt64Nil(fieldName string) *int64
- func (ds *DataSet) GetIntNil(fieldName string) *int
- func (ds *DataSet) GetMacros() []any
- func (ds *DataSet) GetParams() []any
- func (ds *DataSet) GetParamsBatch(index int) []any
- func (ds *DataSet) GetSql() (string, error)
- func (ds *DataSet) GetString(fieldName string) string
- func (ds *DataSet) GetStringNil(fieldName string) *string
- func (ds *DataSet) GetValue(field *Field, fieldType any) any
- func (ds *DataSet) IsEmpty() bool
- func (ds *DataSet) IsNotEmpty() bool
- func (ds *DataSet) IsNotNull(fieldName string) bool
- func (ds *DataSet) IsNull(fieldName string) bool
- func (ds *DataSet) Last()
- func (ds *DataSet) Locate(key string, value any) bool
- func (ds *DataSet) MacroByName(macroName string) *Macro
- func (ds *DataSet) Next()
- func (ds *DataSet) Open() error
- func (ds *DataSet) OpenContext(ctx context.Context) error
- func (ds *DataSet) ParamByName(paramName string) *Param
- func (ds *DataSet) ParseSql() (sqlparser.Statement, error)
- func (ds *DataSet) Prepare() error
- func (ds *DataSet) Previous()
- func (ds *DataSet) PrintParam()
- func (ds *DataSet) SetInputParam(paramName string, paramValue any) *DataSet
- func (ds *DataSet) SetInputParamBlob(paramName string, paramValue []byte) *DataSet
- func (ds *DataSet) SetInputParamClob(paramName string, paramValue string) *DataSet
- func (ds *DataSet) SetMacro(macroName string, macroValue any) *DataSet
- func (ds *DataSet) SetOutputParam(paramName string, paramValue any) *DataSet
- func (ds *DataSet) SetOutputParamSlice(params ...ParamOut) *DataSet
- func (ds *DataSet) SqlParam() string
- func (ds *DataSet) ToStruct(model any) error
- func (ds *DataSet) ToStructJson(model any) ([]byte, error)
- type DataType
- type Field
- func (field *Field) AsBool() bool
- func (field *Field) AsBoolNil() *bool
- func (field *Field) AsByte() []byte
- func (field *Field) AsByteNil() *[]byte
- func (field *Field) AsDateTime() time.Time
- func (field *Field) AsDateTimeNil() *time.Time
- func (field *Field) AsFloat() float32
- func (field *Field) AsFloat64() float64
- func (field *Field) AsFloat64Nil() *float64
- func (field *Field) AsFloatNil() *float32
- func (field *Field) AsInt() int
- func (field *Field) AsInt8() int8
- func (field *Field) AsInt8Nil() *int8
- func (field *Field) AsInt16() int16
- func (field *Field) AsInt16Nil() *int16
- func (field *Field) AsInt32() int32
- func (field *Field) AsInt32Nil() *int32
- func (field *Field) AsInt64() int64
- func (field *Field) AsInt64Nil() *int64
- func (field *Field) AsIntNil() *int
- func (field *Field) AsString() string
- func (field *Field) AsStringNil() *string
- func (field *Field) AsValue() any
- func (field *Field) IsNotNull() bool
- func (field *Field) IsNull() bool
- type Fields
- type Lob
- type Macro
- type Macros
- type OptionsDataset
- type Param
- func (param *Param) AsBool() bool
- func (param *Param) AsDateTime() time.Time
- func (param *Param) AsFloat() float32
- func (param *Param) AsFloat64() float64
- func (param *Param) AsInt() int
- func (param *Param) AsInt8() int8
- func (param *Param) AsInt16() int16
- func (param *Param) AsInt32() int32
- func (param *Param) AsInt64() int64
- func (param *Param) AsString() string
- func (param *Param) AsValue() *variant.Variant
- type ParamOut
- type ParamType
- type Params
- func (p *Params) Add(paramName string) *Param
- func (p *Params) FindParamByName(paramName string) *Param
- func (p *Params) ParamByName(paramName string) *Param
- func (p *Params) PrintParam()
- func (p *Params) SetInputParam(paramName string, paramValue any) *Params
- func (p *Params) SetInputParamBlob(paramName string, paramValue []byte) *Params
- func (p *Params) SetInputParamClob(paramName string, paramValue string) *Params
- func (p *Params) SetOutputParam(paramName string, paramValue any) *Params
- func (p *Params) SetOutputParamSlice(params ...ParamOut) *Params
- type Row
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StrNotEmpty ¶
Types ¶
type DS ¶
type DS interface {
Open() error
OpenContext(ctx context.Context) error
Close()
Exec() (sql.Result, error)
ExecContext(ctx context.Context) (sql.Result, error)
GetSql() (string, error)
GetParams() []any
ParamByName(paramName string) *Param
SetInputParam(paramName string, paramValue any) *DataSet
SetOutputParam(paramName string, paramType any) *DataSet
FieldByName(fieldName string) *Field
Locate(key string, value any) bool
First()
Next()
Eof() bool
IsEmpty() bool
IsNotEmpty() bool
Count() int
AddSql(sql string) *DataSet
ToStruct(model any) error
ToStructJson(model any) ([]byte, error)
}
type DataSet ¶
type DataSet struct {
Connection *dbconnbase.Conn
Transaction *dbconnbase.Transaction
Ctx context.Context
Sql stringlist.Strings
Fields *Fields
Params *Params
Macros *Macros
Rows []Row
Index int
Recno int
IndexFieldNames string
Silent bool
Name string
TagColumn string
}
func NewDataSet ¶
func NewDataSet(db *dbconnbase.Conn, opts ...OptionsDataset) *DataSet
func NewDataSetTx ¶
func NewDataSetTx(tx *dbconnbase.Transaction, opts ...OptionsDataset) *DataSet
func (*DataSet) ClearParams ¶
func (ds *DataSet) ClearParams()
func (*DataSet) CreateFields ¶
func (*DataSet) DeleteContext ¶
func (*DataSet) ExecContext ¶
func (*DataSet) FieldByName ¶
func (*DataSet) GetBoolNil ¶ added in v1.0.171
func (*DataSet) GetByteNil ¶ added in v1.0.171
func (*DataSet) GetDateTime ¶ added in v1.0.171
func (*DataSet) GetDateTimeNil ¶ added in v1.0.171
func (*DataSet) GetFloat64 ¶ added in v1.0.171
func (*DataSet) GetFloat64Nil ¶ added in v1.0.171
func (*DataSet) GetFloatNil ¶ added in v1.0.171
func (*DataSet) GetInt8Nil ¶ added in v1.0.171
func (*DataSet) GetInt16Nil ¶ added in v1.0.171
func (*DataSet) GetInt32Nil ¶ added in v1.0.171
func (*DataSet) GetInt64Nil ¶ added in v1.0.171
func (*DataSet) GetParamsBatch ¶
func (*DataSet) GetStringNil ¶ added in v1.0.171
func (*DataSet) IsNotEmpty ¶
func (*DataSet) MacroByName ¶
func (*DataSet) ParamByName ¶
func (*DataSet) PrintParam ¶
func (ds *DataSet) PrintParam()
func (*DataSet) SetInputParam ¶
func (*DataSet) SetInputParamBlob ¶
func (*DataSet) SetInputParamClob ¶
func (*DataSet) SetOutputParam ¶
func (*DataSet) SetOutputParamSlice ¶
type Field ¶
type Field struct {
Owner *Fields
Name string
Caption string
DataType *sql.ColumnType
IDataType *DataType
Precision int64
Scale int64
DataMask string
BoolValue bool
TrueValue string
FalseValue string
Visible bool
AcceptNull bool
QuoteNull bool
OmitNull bool
StrNull string
Order int
Index int
}
func (*Field) AsDateTime ¶
func (*Field) AsDateTimeNil ¶
func (*Field) AsFloat64Nil ¶
func (*Field) AsFloatNil ¶
func (*Field) AsInt16Nil ¶
func (*Field) AsInt32Nil ¶
func (*Field) AsInt64Nil ¶
func (*Field) AsStringNil ¶
type OptionsDataset ¶
type OptionsDataset func(*DataSet)
func SetName ¶
func SetName(name string) OptionsDataset
type Param ¶
type Param struct {
Owner *Params
Name string
Value *variant.Variant
ParamType ParamType
DataType reflect.Type
Values []*variant.Variant
}
func (*Param) AsDateTime ¶
type Params ¶
func (*Params) FindParamByName ¶
func (*Params) ParamByName ¶
func (*Params) PrintParam ¶
func (p *Params) PrintParam()
func (*Params) SetInputParam ¶
func (*Params) SetInputParamBlob ¶
func (*Params) SetInputParamClob ¶
func (*Params) SetOutputParam ¶
func (*Params) SetOutputParamSlice ¶
Click to show internal directories.
Click to hide internal directories.