Versions in this module Expand all Collapse all v0 v0.0.14 Jan 4, 2026 v0.0.13 Jan 3, 2026 v0.0.12 Jan 3, 2026 v0.0.11 Jan 3, 2026 v0.0.10 Jan 3, 2026 v0.0.9 Jan 3, 2026 v0.0.8 Dec 31, 2025 v0.0.7 Dec 29, 2025 v0.0.6 Dec 17, 2025 v0.0.5 Dec 12, 2025 v0.0.4 Dec 8, 2025 v0.0.3 Dec 8, 2025 Changes in this version + const MetaPrefix + var OperatorAliases = map[string]FilterOperator + var SystemFields = map[string]bool + func GetSystemFieldName(field string) string + func IsMetaField(field string) bool + func IsSystemField(field string) bool + func PopulateEntryDTO(entry *schema.ContentEntry, dto *core.ContentEntryDTO) + type AggregateOperator string + const AggAvg + const AggCount + const AggMax + const AggMin + const AggSum + func (op AggregateOperator) IsValid() bool + type AggregateQuery struct + Aggregations []Aggregation + Filters *FilterGroup + GroupBy []string + Having *FilterGroup + Limit int + Sort []SortField + type AggregateResult struct + GroupKey map[string]interface{} + Values map[string]interface{} + type Aggregation struct + Alias string + Field string + Operator AggregateOperator + type Aggregator struct + func NewAggregator(db *bun.DB) *Aggregator + func (a *Aggregator) GetCMSStats(ctx context.Context, appID, envID xid.ID) (*core.CMSStatsDTO, error) + func (a *Aggregator) GetEntryStats(ctx context.Context, contentTypeID xid.ID) (*core.ContentTypeStatsDTO, error) + func (a *Aggregator) GetTimeSeriesStats(ctx context.Context, contentTypeID xid.ID, dateTrunc string, limit int) ([]map[string]any, error) + func (a *Aggregator) SimpleAggregate(ctx context.Context, contentTypeID xid.ID, config *SimpleAggregateConfig) ([]*SimpleAggregateResult, error) + type FilterCondition struct + Field string + Operator FilterOperator + Type string + Value interface{} + type FilterGroup struct + Conditions []FilterCondition + Groups []*FilterGroup + Operator LogicalOperator + type FilterOperator string + const OpAll + const OpAny + const OpBetween + const OpContains + const OpEndsWith + const OpEqual + const OpExists + const OpGreaterThan + const OpGreaterThanEqual + const OpILike + const OpIn + const OpJsonContains + const OpJsonHasKey + const OpLessThan + const OpLessThanEqual + const OpLike + const OpNotEqual + const OpNotIn + const OpNull + const OpStartsWith + func ParseOperator(s string) (FilterOperator, bool) + func ResolveOperator(s string) (FilterOperator, bool) + func (op FilterOperator) IsValid() bool + func (op FilterOperator) RequiresValue() bool + type JSONParser struct + func NewJSONParser() *JSONParser + func (p *JSONParser) Parse(data []byte) (*Query, error) + func (p *JSONParser) ParseJSONQuery(jq *JSONQuery) (*Query, error) + type JSONQuery struct + Fields []string + Filter interface{} + Filters interface{} + Include interface{} + Limit int + Offset int + Page int + PageSize int + PerPage int + Populate interface{} + Q string + Search string + Select []string + Sort interface{} + Status string + Where interface{} + type LogicalOperator string + const LogicalAnd + const LogicalNot + const LogicalOr + func (op LogicalOperator) IsValid() bool + type OperatorInfo struct + ApplicableTo []string + Description string + Example string + Name string + Operator FilterOperator + ValueType string + func GetAllOperators() []OperatorInfo + func GetOperatorInfo(op FilterOperator) *OperatorInfo + func GetOperatorsForFieldType(fieldType string) []OperatorInfo + type PopulateConfig struct + Fields []string + MaxDepth int + SelectFields map[string][]string + func DefaultPopulateConfig() *PopulateConfig + func ParsePopulate(populate string) *PopulateConfig + type PopulateOption struct + Path string + Populate []PopulateOption + Select []string + type Populator struct + func NewPopulator(db *bun.DB) *Populator + func (p *Populator) GetRelatedEntries(ctx context.Context, entryID xid.ID, fieldSlug string) ([]*schema.ContentEntry, error) + func (p *Populator) GetRelatedEntryIDs(ctx context.Context, entryID xid.ID, fieldSlug string) ([]xid.ID, error) + func (p *Populator) GetReverseRelatedEntries(ctx context.Context, entryID xid.ID, fieldSlug string) ([]*schema.ContentEntry, error) + func (p *Populator) PopulateEntries(ctx context.Context, entries []*schema.ContentEntry, config *PopulateConfig) error + func (p *Populator) PopulateEntry(ctx context.Context, entry *schema.ContentEntry, config *PopulateConfig) error + type Query struct + Filters *FilterGroup + Limit int + Offset int + Page int + PageSize int + Populate []PopulateOption + Search string + Select []string + Sort []SortField + Status string + func NewQuery() *Query + func (q *Query) AddFilter(field string, operator FilterOperator, value interface{}) *Query + func (q *Query) AddPopulate(path string, selectFields ...string) *Query + func (q *Query) AddSelect(fields ...string) *Query + func (q *Query) AddSort(field string, descending bool) *Query + func (q *Query) SetOffsetLimit(offset, limit int) *Query + func (q *Query) SetPagination(page, pageSize int) *Query + func (q *Query) Validate(fields map[string]*core.ContentFieldDTO) error + type QueryBuilder struct + func NewQueryBuilder(db *bun.DB, contentTypeID xid.ID, fields []*schema.ContentField) *QueryBuilder + func (b *QueryBuilder) Build(q *Query) *bun.SelectQuery + func (b *QueryBuilder) BuildCount(q *Query) *bun.SelectQuery + type QueryExecutor struct + func NewQueryExecutor(db *bun.DB) *QueryExecutor + func (e *QueryExecutor) Execute(ctx context.Context, contentType *schema.ContentType, q *Query) (*QueryResult, error) + func (e *QueryExecutor) ExecuteAggregate(ctx context.Context, contentType *schema.ContentType, q *AggregateQuery) ([]AggregateResult, error) + func (e *QueryExecutor) ExecuteByID(ctx context.Context, entryID xid.ID) (*schema.ContentEntry, error) + func (e *QueryExecutor) ExecuteCount(ctx context.Context, contentType *schema.ContentType, q *Query) (int, error) + func (e *QueryExecutor) ExecuteDistinct(ctx context.Context, contentType *schema.ContentType, field string, q *Query) ([]interface{}, error) + func (e *QueryExecutor) ExecuteExists(ctx context.Context, contentType *schema.ContentType, q *Query) (bool, error) + func (e *QueryExecutor) ExecuteIDs(ctx context.Context, contentType *schema.ContentType, q *Query) ([]xid.ID, error) + type QueryResult struct + Entries []*schema.ContentEntry + Page int + PageSize int + TotalItems int + TotalPages int + type SearchConfig struct + Fields []string + HighlightEndTag string + HighlightStartTag string + IncludeHighlights bool + Language string + MinScore float64 + Query string + func DefaultSearchConfig() *SearchConfig + type SearchResult struct + Entry *schema.ContentEntry + Highlights map[string]string + Score float64 + type Searcher struct + func NewSearcher(db *bun.DB) *Searcher + func (s *Searcher) Search(ctx context.Context, contentTypeID xid.ID, config *SearchConfig, ...) ([]*SearchResult, int, error) + func (s *Searcher) SearchAll(ctx context.Context, appID, envID xid.ID, config *SearchConfig, ...) ([]*SearchResult, int, error) + func (s *Searcher) SuggestSearch(ctx context.Context, contentTypeID xid.ID, prefix string, limit int) ([]string, error) + type SimpleAggregateConfig struct + DateTrunc string + Field string + Filters map[string]any + GroupBy string + Operator AggregateOperator + type SimpleAggregateResult struct + Avg float64 + Count int + GroupValue any + Max any + Min any + Sum float64 + type SortField struct + Descending bool + Field string + type URLParser struct + func NewURLParser() *URLParser + func (p *URLParser) Parse(values url.Values) (*Query, error) + func (p *URLParser) ToURLValues(q *Query) url.Values