Versions in this module Expand all Collapse all v0 v0.10.0 Aug 5, 2026 Changes in this version type Limits + MaxOffset int v0.9.0 Aug 3, 2026 v0.8.0 Aug 2, 2026 v0.7.0 Aug 1, 2026 v0.6.0 Aug 1, 2026 v0.5.0 Jul 31, 2026 Changes in this version + const OpBetween + const OpEq + const OpGt + const OpGte + const OpILike + const OpIn + const OpIsNull + const OpLike + const OpLt + const OpLte + const OpNe + const OpNotIn + const OpNotNull + var ErrNoChanges = errors.New("no columns to change") + var ErrNotFound = errors.New("not found") + var Schema string + func CountAuthor(ctx context.Context, db DB, where []Condition) (int64, error) + func CountOrg(ctx context.Context, db DB, where []Condition) (int64, error) + func CountPost(ctx context.Context, db DB, where []Condition) (int64, error) + func DeleteAuthor(ctx context.Context, db DB, id any, where []Condition) error + func DeleteOrg(ctx context.Context, db DB, id any, where []Condition) error + func DeletePost(ctx context.Context, db DB, id any, where []Condition) error + func ParseBool(s string) (any, error) + func ParseFloat(s string) (any, error) + func ParseInt(s string) (any, error) + func ParseText(s string) (any, error) + func ParseTime(s string) (any, error) + func Register(mux *http.ServeMux, db DB, opts Options) error + func WriteJSON(w http.ResponseWriter, status int, body any) + func WriteProblem(w http.ResponseWriter, err error) + type Author struct + CreatedAt time.Time + Email string + ID string + Name string + OrgID string + PasswordHash string + UpdatedAt time.Time + func GetAuthor(ctx context.Context, db DB, id any, where []Condition) (Author, error) + func InsertAuthor(ctx context.Context, db DB, values map[string]any) (Author, error) + func ListAuthor(ctx context.Context, db DB, q Query) ([]Author, error) + func UpdateAuthor(ctx context.Context, db DB, id any, changes map[string]any, where []Condition) (Author, error) + type AuthorsHooks struct + Assign func(*http.Request) (map[string]any, error) + Confine func(*http.Request) ([]Condition, error) + type Column struct + Filterable bool + Name string + Parse func(string) (any, error) + Searchable bool + Sortable bool + type Condition struct + Column string + Op string + Or []Condition + Value any + Value2 any + Values []any + type DB interface + Exec func(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error) + Query func(ctx context.Context, sql string, args ...any) (pgx.Rows, error) + QueryRow func(ctx context.Context, sql string, args ...any) pgx.Row + type Limits struct + DefaultPageSize int + MaxFilters int + MaxPageSize int + MaxSortTerms int + type ListRequest struct + Count bool + Page int + PerPage int + Query Query + func ParseList(values url.Values, cols []Column, lim Limits) (ListRequest, error) + type Options struct + Authors AuthorsHooks + Orgs OrgsHooks + Posts PostsHooks + type Order struct + Column string + Desc bool + type Org struct + CreatedAt time.Time + ID string + Name string + Slug string + UpdatedAt time.Time + func GetOrg(ctx context.Context, db DB, id any, where []Condition) (Org, error) + func InsertOrg(ctx context.Context, db DB, values map[string]any) (Org, error) + func ListOrg(ctx context.Context, db DB, q Query) ([]Org, error) + func UpdateOrg(ctx context.Context, db DB, id any, changes map[string]any, where []Condition) (Org, error) + type OrgsHooks struct + Assign func(*http.Request) (map[string]any, error) + Confine func(*http.Request) ([]Condition, error) + type Page struct + HasMore bool + Items []T + Page int + PerPage int + Total *int64 + type Post struct + AuthorID string + Body string + CreatedAt time.Time + DeletedAt *time.Time + ID string + OrgID string + PublishedAt *time.Time + Status string + Title string + UpdatedAt time.Time + ViewCount int64 + func GetPost(ctx context.Context, db DB, id any, where []Condition) (Post, error) + func InsertPost(ctx context.Context, db DB, values map[string]any) (Post, error) + func ListPost(ctx context.Context, db DB, q Query) ([]Post, error) + func UpdatePost(ctx context.Context, db DB, id any, changes map[string]any, where []Condition) (Post, error) + type PostsHooks struct + Assign func(*http.Request) (map[string]any, error) + Confine func(*http.Request) ([]Condition, error) + type Problem struct + Detail string + Errors []*ProblemDetail + Status int + Title string + Type string + func (p *Problem) Error() string + type ProblemDetail struct + Allowed []string + Location string + Message string + type Query struct + Limit int + Offset int + Order []Order + Where []Condition