Documentation
¶
Index ¶
- Constants
- Variables
- func AsBool(v any) bool
- func AsByte(v any) byte
- func AsBytes(v any) (b []byte)
- func AsFloat32(v any) float32
- func AsFloat64(v any) float64
- func AsInt16(v any) int16
- func AsInt32(v any) int32
- func AsInt64(v any) int64
- func AsInt8(v any) int8
- func AsString(src any) string
- func AsTime(v any) (r time.Time, err error)
- func AsUint16(v any) uint16
- func AsUint32(v any) uint32
- func AsUint64(v any) uint64
- func AsUint8(v any) byte
- func GetValue(fieldType reflect.Type, src any) any
- func IsBytes(fieldValueVal reflect.Value) bool
- func ScanValue(desc reflect.Value, src any)
- type Col
- type Column
- type DBType
- type DBhandle
- type DataBean
- func (g *DataBean) FieldByIndex(index int) (_r *FieldBeen)
- func (g *DataBean) FieldByName(name string) (_r *FieldBeen)
- func (g *DataBean) FirstField() *FieldBeen
- func (g *DataBean) GetError() error
- func (g *DataBean) Len() int
- func (g *DataBean) Map() map[string]*FieldBeen
- func (g *DataBean) Put(name string, fb *FieldBeen)
- func (g *DataBean) Scan(v any) (err error)
- func (g *DataBean) ScanAndFree(v any) (err error)
- func (g *DataBean) SetError(err error)
- func (g *DataBean) String() (r string)
- func (g *DataBean) ToBool() (r bool)
- func (g *DataBean) ToBytes() (r []byte)
- func (g *DataBean) ToFloat64() (r float64)
- func (g *DataBean) ToInt64() (r int64)
- func (g *DataBean) ToString() (r string)
- func (g *DataBean) ToTime() (r time.Time)
- func (g *DataBean) ToUint64() (r uint64)
- func (g *DataBean) ValueByIndex(index int) (_val any)
- func (g *DataBean) ValueByName(name string) (_val any)
- type DataBeans
- type Field
- func (f *Field[T]) Asc() *Sort[T]
- func (f *Field[T]) Avg() *Func[T]
- func (f *Field[T]) Between(from, to any) *Where[T]
- func (f *Field[T]) Count() *Func[T]
- func (f *Field[T]) Desc() *Sort[T]
- func (f *Field[T]) Distinct() *Func[T]
- func (f *Field[T]) EQ(arg any) *Where[T]
- func (f *Field[T]) GE(arg any) *Where[T]
- func (f *Field[T]) GT(arg any) *Where[T]
- func (f *Field[T]) IN(args ...any) *Where[T]
- func (f *Field[T]) LE(arg any) *Where[T]
- func (f *Field[T]) LIKE(arg any) *Where[T]
- func (f *Field[T]) LLIKE(arg any) *Where[T]
- func (f *Field[T]) LT(arg any) *Where[T]
- func (f *Field[T]) Max() *Func[T]
- func (f *Field[T]) Min() *Func[T]
- func (f *Field[T]) NEQ(arg any) *Where[T]
- func (f *Field[T]) NOTIN(args ...any) *Where[T]
- func (f *Field[T]) Name() string
- func (f *Field[T]) Operation(qurey4SetOperation string) *Func[T]
- func (f *Field[T]) RLIKE(arg any) *Where[T]
- func (f *Field[T]) Sum() *Func[T]
- type FieldBeen
- func (f *FieldBeen) Value() (r any)
- func (f *FieldBeen) ValueBool() bool
- func (f *FieldBeen) ValueBytes() []byte
- func (f *FieldBeen) ValueFloat32() float32
- func (f *FieldBeen) ValueFloat64() float64
- func (f *FieldBeen) ValueInt16() int16
- func (f *FieldBeen) ValueInt32() int32
- func (f *FieldBeen) ValueInt64() int64
- func (f *FieldBeen) ValueString() string
- func (f *FieldBeen) ValueTime() (t time.Time)
- func (f *FieldBeen) ValueUint16() uint16
- func (f *FieldBeen) ValueUint32() uint32
- func (f *FieldBeen) ValueUint64() uint64
- type Func
- func (s *Func[T]) AS(alias Column[T]) *Func[T]
- func (s *Func[T]) Between(from, to any) *Having[T]
- func (s *Func[T]) EQ(arg any) *Having[T]
- func (s *Func[T]) GE(arg any) *Having[T]
- func (s *Func[T]) GT(arg any) *Having[T]
- func (s *Func[T]) LE(arg any) *Having[T]
- func (s *Func[T]) LT(arg any) *Having[T]
- func (s *Func[T]) NEQ(arg any) *Having[T]
- func (s *Func[T]) Name() string
- func (s *Func[T]) Value() any
- type Having
- type In
- type InOut
- type Out
- type Scanner
- type Serialize
- type Serializer
- type Sort
- type TableBase
- type Transaction
- type Where
Constants ¶
const VERSION = "1.2.0"
Variables ¶
var ( GetMapperIds func(string) []string HasMapperId func(string) bool GetMapperDBhandle func(string, string, bool) DBhandle )
var Logger = logger
var MapperPre = string(base58.EncodeForInt64(uint64(uuid.NewUUID().Int64())))
Functions ¶
Types ¶
type DBhandle ¶
type DBhandle interface { GetTransaction() (r Transaction, err error) ExecuteQueryBean(sql string, args ...any) *DataBean ExecuteQueryBeans(sql string, args ...any) *DataBeans ExecuteUpdate(sql string, args ...any) (sql.Result, error) ExecuteBatch(sql string, args [][]any) (r []sql.Result, err error) GetDBType() DBType GetDB() *sql.DB Close() error }
type DataBean ¶
type DataBean struct {
// contains filtered or unexported fields
}
func NewDataBean ¶
func (*DataBean) FieldByIndex ¶
func (*DataBean) FieldByName ¶
func (*DataBean) FirstField ¶ added in v1.1.1
func (*DataBean) Scan ¶ added in v1.1.1
Scan copies the data from the DataBean into the provided variable 'v'. This method is typically used to transfer data out of the DataBean and into another data structure or variable.
func (*DataBean) ScanAndFree ¶ added in v1.1.2
ScanAndFree copies the data from the DataBean into the provided variable 'v'. This method is typically used to transfer data out of the DataBean and into another data structure or variable.
After calling this method, the data in the DataBean will be recycled and should not be used anymore. It is the caller's responsibility to ensure that the DataBean is not accessed after calling Scan, as the internal data may have been cleared or reused for subsequent operations.
func (*DataBean) ValueByIndex ¶
func (*DataBean) ValueByName ¶
type DataBeans ¶ added in v1.1.1
type DataBeans struct { Beans []*DataBean // contains filtered or unexported fields }
func (*DataBeans) Scan ¶ added in v1.1.1
Scan copies the data from the DataBeans into the provided variable 'v'. This method is typically used to transfer data out of the DataBean and into another data structure or variable.
func (*DataBeans) ScanAndFree ¶ added in v1.1.2
ScanAndFree copies the data from the DataBeans into the provided variable 'v'. This method is typically used to transfer data out of the DataBean and into another data structure or variable.
After calling this method, the data in the DataBeans will be recycled and should not be used anymore. It is the caller's responsibility to ensure that the DataBeans is not accessed after calling Scan, as the internal data may have been cleared or reused for subsequent operations.
type Field ¶
type FieldBeen ¶
type FieldBeen struct {
FieldValue *any
}
func NewFieldBeen ¶ added in v1.1.1
func NewFieldBeen() *FieldBeen
func (*FieldBeen) ValueBytes ¶
func (*FieldBeen) ValueFloat32 ¶
func (*FieldBeen) ValueFloat64 ¶
func (*FieldBeen) ValueInt16 ¶
func (*FieldBeen) ValueInt32 ¶
func (*FieldBeen) ValueInt64 ¶
func (*FieldBeen) ValueString ¶
func (*FieldBeen) ValueUint16 ¶
func (*FieldBeen) ValueUint32 ¶
func (*FieldBeen) ValueUint64 ¶
type Scanner ¶ added in v1.1.1
type Scanner interface { Scan(fieldname string, value any) // ToGdao // : when don't create an object by calling a New method of the standardized entity class, // but by using some other method such as the new keyword, then should call the ToGdao function, // which initializes the relevant data for database operations ToGdao() }
type Serializer ¶
type Serializer struct { }