Versions in this module Expand all Collapse all v0 v0.3.1 Sep 3, 2026 Changes in this version type Queries + func (q *Queries) Insert(query string, args ...any) error + func (q *Queries) Update(query string, args ...any) error v0.3.0 Sep 3, 2026 v0.2.0 Jul 30, 2026 Changes in this version + var ErrInvalidUpdatePayload = errors.New("invalid update payload: must be a struct or pointer to struct") + var ErrNoFieldsToUpdate = errors.New("no fields to update") + var ErrNoRowsAffected = errors.New("no rows affected") + func GetColumns(cols []string) string + func GetColumnsWithPrefix(prefix string, cols []string) string + func IsUniqueConstraintError(err error) bool + func IsUpdatePayloadEmpty(payload any) bool + func Open(host, port, user, password, dbname, sslmode string) (*sqlx.DB, error) + func SliceToIdsSlice[T any](items []*T, extractor func(*T) int) []int + func SliceToIndexMap[T any, K comparable](items []*T, keyExtractor func(*T) K) map[K]*T + func SliceToOptionalIdsSlice[T any](items []*T, extractor func(*T) *int) []int + func SliceToResponseMap[T any, R any, K comparable](items []*T, extractor func(*T) (K, R)) map[K]R + func SliceToStringSlice[T any](items []*T, extractor func(*T) string) []string + type BuildWhereClausePaginationParams struct + Parsed *pagination.Parsed + TimeColumn string + type BuildWhereClauseParams struct + Pagination *BuildWhereClausePaginationParams + type Queries struct + func NewQueries(ex SQLExecutor) *Queries + func (q *Queries) BuildUpdateQuery(tableName string, payload any, conditions []WhereCondition) (string, []any, error) + func (q *Queries) BuildWhereClause(conditions []WhereCondition, params BuildWhereClauseParams) (string, []any) + func (q *Queries) Delete(query string, args ...any) error + func (q *Queries) InsertWithDest(dest any, returningColumns string, query string, args ...any) error + func (q *Queries) UpdateWithDest(dest any, returningColumns string, query string, args ...any) error + type SQLExecutor interface + Exec func(query string, args ...any) (sql.Result, error) + Get func(dest any, query string, args ...any) error + NamedExec func(query string, arg any) (sql.Result, error) + QueryRowx func(query string, args ...any) *sqlx.Row + Queryx func(query string, args ...any) (*sqlx.Rows, error) + Rebind func(query string) string + Select func(dest any, query string, args ...any) error + type UpdateField struct + Set bool + Value *T + func (uf UpdateField[T]) Get() any + func (uf UpdateField[T]) IsSet() bool + type UpdateItem interface + Get func() any + IsSet func() bool + type WhereCondition struct + Args []any + Clause string