Documentation ¶
Index ¶
- Constants
- Variables
- func Count[T TableNameType](conds []KeyValueField) (n int64, err error)
- func Delete[T TableNameType](conds []KeyValueField) error
- func Exists[T TableNameType](conds []KeyValueField) (bool, error)
- func Find[T TableNameType](fields []string, conds []KeyValueField) ([]*T, error)
- func FindLimit[T TableNameType](fields []string, conds []KeyValueField, orderBy string, offset int, limit int) ([]*T, error)
- func FindRow[T TableNameType](fields []string, conds []KeyValueField) (*T, error)
- func Insert[T TableNameType](attributes []KeyValueField) (*T, error)
- func InsertSkipExists[T TableNameType](attributes []KeyValueField, skipExists bool) (*T, error)
- func ItemResp[M TableNameType, MR ModelResp](m *M) *MR
- func ListResp[M TableNameType, MR ModelResp]() ([]*MR, error)
- func Setup()
- func UpdateFields[T TableNameType](id int64, fields []KeyValueField) bool
- func UpdateRow[T TableNameType](id int64, field string, value any) bool
- type Attribute
- type InQuery
- type KeyValueField
- type ModelResp
- type TableNameType
Constants ¶
View Source
const AND = " AND "
View Source
const EQ = "="
View Source
const IN = "IN"
View Source
const InvalidCount = -1
Variables ¶
View Source
var Pool *pgxpool.Pool
Functions ¶
func Count ¶
func Count[T TableNameType](conds []KeyValueField) (n int64, err error)
func Delete ¶
func Delete[T TableNameType](conds []KeyValueField) error
func Exists ¶
func Exists[T TableNameType](conds []KeyValueField) (bool, error)
func Find ¶
func Find[T TableNameType](fields []string, conds []KeyValueField) ([]*T, error)
func FindLimit ¶
func FindLimit[T TableNameType](fields []string, conds []KeyValueField, orderBy string, offset int, limit int) ([]*T, error)
limit = 0 means no limit
func FindRow ¶
func FindRow[T TableNameType](fields []string, conds []KeyValueField) (*T, error)
func Insert ¶
func Insert[T TableNameType](attributes []KeyValueField) (*T, error)
func InsertSkipExists ¶
func InsertSkipExists[T TableNameType](attributes []KeyValueField, skipExists bool) (*T, error)
func ItemResp ¶
func ItemResp[M TableNameType, MR ModelResp](m *M) *MR
func ListResp ¶
func ListResp[M TableNameType, MR ModelResp]() ([]*MR, error)
func UpdateFields ¶
func UpdateFields[T TableNameType](id int64, fields []KeyValueField) bool
Types ¶
type Attribute ¶
func (*Attribute) ValueField ¶
type InQuery ¶
func (*InQuery[T]) ValueField ¶
type KeyValueField ¶
type TableNameType ¶
type TableNameType interface {
TableName() string
}
Click to show internal directories.
Click to hide internal directories.