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(context 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) GetMacros() []any
- func (ds *DataSet) GetParams() []any
- func (ds *DataSet) GetParamsBatch(index int) []any
- func (ds *DataSet) GetSql() (sql string)
- func (ds *DataSet) GetValue(field *Field, fieldType any) any
- func (ds *DataSet) IsEmpty() bool
- func (ds *DataSet) IsNotEmpty() 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(context 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 {
NewDataSet(db *dbconnbase.Conn) *DataSet
Open() error
Close()
Exec() (sql.Result, error)
GetSql() (sql string)
GetParams() []any
Scan(list *sql.Rows)
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
Transction *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) GetParamsBatch ¶
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.