Documentation ¶
Overview ¶
The `types` package is reference from :
https://jackieli.dev/posts/pointers-in-go-used-in-sql-scanner/
This package is a helper library to prevent the value being fallback using reflection in `database/sql`.
Index ¶
- func BinaryMarshaler[T interface{ ... }](addr T) binaryMarshaler[T]
- func BinaryUnmarshaler[T any, Ptr interface{ ... }](addr Ptr) binaryUnmarshaler[T, Ptr]
- func Bool[T ~bool](addr *T, strict ...bool) boolLike[T]
- func BoolList[T ~bool](v *[]T) boolList[T]
- func Date(addr *civil.Date, strict ...bool) localDate
- func Float[T constraints.Float](addr *T, strict ...bool) floatLike[T]
- func FloatList[T constraints.Float](v *[]T) floatList[T]
- func IntList[T constraints.Signed](v *[]T) intList[T]
- func Integer[T constraints.Integer](addr *T, strict ...bool) intLike[T]
- func PtrOf[T any](v T) *T
- func PtrOfBool[T ~bool](v **T) ptrOfBoolLike[T]
- func PtrOfDate(addr **civil.Date) ptrOfLocalDate
- func PtrOfFloat[T constraints.Float](v **T) ptrOfFloatLike[T]
- func PtrOfInt[T constraints.Integer](v **T) ptrOfIntLike[T]
- func PtrOfString[T StringLikeType](v **T) ptrOfStrLike[T]
- func PtrOfTime[T time.Time](v **T) ptrOfTime[T]
- func String[T StringLikeType](addr *T, strict ...bool) strLike[T]
- func StringList[T ~string](v *[]T) strList[T]
- func TextMarshaler[T interface{ ... }](addr T) textMarshaler[T]
- func TextUnmarshaler[T any, Ptr interface{ ... }](addr Ptr) textUnmarshaler[T, Ptr]
- func Time[T time.Time](addr *T, strict ...bool) datetime[T]
- func UintList[T constraints.Unsigned](v *[]T) uintList[T]
- type StringLikeType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinaryMarshaler ¶
func BinaryMarshaler[T interface { encoding.BinaryMarshaler }](addr T) binaryMarshaler[T]
func BinaryUnmarshaler ¶
func BinaryUnmarshaler[T any, Ptr interface { *T encoding.BinaryUnmarshaler }](addr Ptr) binaryUnmarshaler[T, Ptr]
func Float ¶
func Float[T constraints.Float](addr *T, strict ...bool) floatLike[T]
Float returns a sql.Scanner
func FloatList ¶
func FloatList[T constraints.Float](v *[]T) floatList[T]
func IntList ¶
func IntList[T constraints.Signed](v *[]T) intList[T]
func Integer ¶
func Integer[T constraints.Integer](addr *T, strict ...bool) intLike[T]
func PtrOfFloat ¶
func PtrOfFloat[T constraints.Float](v **T) ptrOfFloatLike[T]
func PtrOfInt ¶
func PtrOfInt[T constraints.Integer](v **T) ptrOfIntLike[T]
func PtrOfString ¶
func PtrOfString[T StringLikeType](v **T) ptrOfStrLike[T]
func String ¶
func String[T StringLikeType](addr *T, strict ...bool) strLike[T]
func StringList ¶
func StringList[T ~string](v *[]T) strList[T]
func TextMarshaler ¶
func TextMarshaler[T interface { encoding.TextMarshaler }](addr T) textMarshaler[T]
func TextUnmarshaler ¶
func TextUnmarshaler[T any, Ptr interface { *T encoding.TextUnmarshaler }](addr Ptr) textUnmarshaler[T, Ptr]
func UintList ¶
func UintList[T constraints.Unsigned](v *[]T) uintList[T]
Types ¶
type StringLikeType ¶
Click to show internal directories.
Click to hide internal directories.