Documentation ¶
Index ¶
- Constants
- Variables
- type Condition
- type ConditionGroup
- type Config
- type DBConfig
- type DatabaseHelper
- 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 Joiner
- type KeysConfig
- type Scanner
Constants ¶
View Source
const ( OPR_EQUAL = "=" OPR_IN = "IN" OPR_ANY = "ANY" OPR_GTE = ">=" )
Variables ¶
View Source
var ( ErrDuplicateKey = fmt.Errorf("DUPLICATE KEY") ErrNotFound = fmt.Errorf("NOT FOUND") )
Functions ¶
This section is empty.
Types ¶
type ConditionGroup ¶
type ConditionGroup struct { Join Joiner Conditions []*Condition Group *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) 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.