Documentation ¶
Index ¶
- Constants
- Variables
- type Condition
- type ConditionGroup
- type Config
- type DBConfig
- type DatabaseHelper
- func (dh *DatabaseHelper) AddSort(sort *Sort) (query string)
- func (dh *DatabaseHelper) BuildDynamicQuery(values *[]any, opts []*ConditionGroup) string
- func (dh *DatabaseHelper) Exec(ctx context.Context, query string, values ...any) error
- func (dh *DatabaseHelper) Exist(ctx context.Context, table string, condition string, values ...any) (bool, error)
- func (dh *DatabaseHelper) MakeTx(ctx context.Context) (pgx.Tx, func(err error) error, error)
- func (dh *DatabaseHelper) Query(ctx context.Context, scanner Scanner, query string, values ...any) error
- type Dir
- type Joiner
- type KeysConfig
- type Scanner
- type Sort
Constants ¶
View Source
const ( OPR_EQUAL = "=" OPR_NOT_EQUAL = "!=" OPR_IN = "IN" OPR_ANY = "ANY" OPR_GTE = ">=" OPR_GT = ">" OPR_LTE = "<=" OPR_LT = "<" OPR_LIKE = "ILIKE" OPR_NOT_LIKE = "NOT ILIKE" OPR_IS = "IS" OPR_IS_NOT = "IS NOT" OPR_IS_NULL = "_NULL_" )
Variables ¶
View Source
var ( ErrDuplicateKey = fmt.Errorf("DUPLICATE KEY") ErrNotFound = fmt.Errorf("NOT FOUND") )
Functions ¶
This section is empty.
Types ¶
type ConditionGroup ¶
type Config ¶
type DBConfig ¶
type DBConfig interface {
MakeDSN() string
}
func GetConfigFromEnv ¶
func GetConfigFromEnvOption ¶ added in v0.0.5
func GetConfigFromEnvOption(keys *KeysConfig) (DBConfig, error)
type DatabaseHelper ¶
func (*DatabaseHelper) AddSort ¶ added in v0.0.13
func (dh *DatabaseHelper) AddSort(sort *Sort) (query string)
func (*DatabaseHelper) BuildDynamicQuery ¶ added in v0.0.7
func (dh *DatabaseHelper) BuildDynamicQuery(values *[]any, opts []*ConditionGroup) string
type KeysConfig ¶ added in v0.0.5
Click to show internal directories.
Click to hide internal directories.