Versions in this module Expand all Collapse all v1 v1.0.0 Jul 18, 2026 Changes in this version + const SyntaxVersion + func Apply[T any](db *gorm.DB, schema *ModelSchema[T], q Query) (*gorm.DB, error) + func ValidateConfig[T any](db *gorm.DB, config Config[T]) error + type ComparisonExpr struct + Field string + FieldSource Span + Literal Literal + Literals []Literal + OpSource Span + Operator ComparisonOperator + Source Span + func (e *ComparisonExpr) Span() Span + type ComparisonOperator uint8 + const Contains + const EndsWith + const Eq + const Gt + const Gte + const In + const IsNotNull + const IsNull + const Lt + const Lte + const Ne + const NotIn + const StartsWith + func (op ComparisonOperator) MarshalText() ([]byte, error) + func (op ComparisonOperator) String() string + type Config struct + AllowCompatibilityAliases bool + AllowCount bool + DefaultLimit int + MaxCursorBytes int + MaxExpressionDepth int + MaxFilterBytes int + MaxInValues int + MaxLimit int + MaxLiteralBytes int + MaxNodes int + MaxOffset int + MaxPathDepth int + MaxQuantifierDepth int + MaxQueryBytes int + MaxSearchBytes int + MaxSortTerms int + MaxTokens int + Policy *SchemaBuilder[T] + Search SearchFunc + type DateValue string + type DecimalValue string + type EndpointDescription struct + CompatibilityAliases bool + Count bool + Limits Limits + Pagination PaginationDescription + Schema SchemaDescription + Search bool + SyntaxVersion string + type Engine struct + func New[T any](db *gorm.DB, config Config[T]) (*Engine[T], error) + func (e *Engine[T]) Apply(ctx context.Context, base *gorm.DB, q Query) (*gorm.DB, error) + func (e *Engine[T]) Describe() EndpointDescription + func (e *Engine[T]) From(base *gorm.DB) Session[T] + func (e *Engine[T]) List(ctx context.Context, values url.Values) (Page[T], error) + func (e *Engine[T]) Parse(values url.Values) (Query, error) + type Error struct + AllowedOperators []ComparisonOperator + Cause error + Code ErrorCode + Field string + Kind *Kind + Message string + Operator *ComparisonOperator + Parameter string + Position *Position + func (e *Error) Error() string + func (e *Error) Unwrap() error + type ErrorCode string + const CodeExecutionFailed + const CodeInvalidCursor + const CodeInvalidLiteral + const CodeInvalidParameter + const CodeInvalidRelationship + const CodeInvalidSchema + const CodeInvalidSyntax + const CodeInvalidToken + const CodeLimitExceeded + const CodeNotFilterable + const CodeNotSortable + const CodeOperatorNotAllowed + const CodeUnknownField + type Expr interface + Span func() Span + type FieldDescription struct + Codec string + Filterable bool + Kind Kind + Name string + Nullable bool + Operators []ComparisonOperator + Sortable bool + type FieldOption interface + func Column(name string) FieldOption + func Filterable(operators ...ComparisonOperator) FieldOption + func GoField(name string) FieldOption + func Sortable() FieldOption + func WithCodec(codec ScalarCodec) FieldOption + type Kind uint8 + const Bool + const Custom + const Date + const Decimal + const Float + const Int + const String + const Time + const UUID + const Uint + func (k Kind) MarshalText() ([]byte, error) + func (k Kind) String() string + type Limits struct + MaxCursorBytes int + MaxExpressionDepth int + MaxFilterBytes int + MaxInValues int + MaxLimit int + MaxLiteralBytes int + MaxNodes int + MaxOffset int + MaxPathDepth int + MaxQuantifierDepth int + MaxQueryBytes int + MaxSearchBytes int + MaxSortTerms int + MaxTokens int + type Literal struct + Kind LiteralKind + Raw string + Source Span + Value any + type LiteralKind uint8 + const BoolLiteral + const NumberLiteral + const StringLiteral + type LogicalExpr struct + Left Expr + Operator LogicalOperator + Right Expr + Source Span + func (e *LogicalExpr) Span() Span + type LogicalOperator uint8 + const And + const Or + func (op LogicalOperator) MarshalText() ([]byte, error) + func (op LogicalOperator) String() string + type ModelSchema struct + func (s *ModelSchema[T]) Describe() SchemaDescription + type NestedPolicy interface + type NotExpr struct + Expr Expr + Source Span + func (e *NotExpr) Span() Span + type OrderTerm = SortTerm + type Page struct + Items []T + Page PageInfo + Total *int64 + type PageInfo struct + HasMore bool + Limit int + NextCursor string + Offset int + type PaginationDescription struct + Cursor bool + DefaultLimit int + MaxLimit int + MaxOffset int + type ParseOption interface + func WithCompatibilityAliases() ParseOption + func WithLimits(limits Limits) ParseOption + type Position struct + Column int + Line int + Offset int + type QuantifierExpr struct + Operator QuantifierOperator + OperatorSource Span + Predicate Expr + Relationship string + RelationshipSource Span + Source Span + Variable string + VariableSource Span + func (e *QuantifierExpr) Span() Span + type QuantifierOperator uint8 + const All + const Any + func (op QuantifierOperator) MarshalText() ([]byte, error) + func (op QuantifierOperator) String() string + type Query struct + Count *bool + Cursor *string + Filter Expr + Limit *int + Offset *int + Search *string + Sort []SortTerm + func ParseHTTP(values url.Values, options ...ParseOption) (Query, error) + type RelationshipCardinality string + const RelationshipMany + const RelationshipOne + type RelationshipDescription struct + Cardinality RelationshipCardinality + Filterable bool + Name string + Schema SchemaDescription + Sortable bool + type RelationshipOption interface + func RelationGoField(name string) RelationshipOption + type ScalarCodec interface + Name func() string + ParseLiteral func(Literal, reflect.Type) (any, error) + ValidateType func(reflect.Type) error + type SchemaBuilder struct + func Schema[T any]() *SchemaBuilder[T] + func (b *SchemaBuilder[T]) Bind(db *gorm.DB) (*ModelSchema[T], error) + func (b *SchemaBuilder[T]) Build() (*ModelSchema[T], error) + func (b *SchemaBuilder[T]) Expose(publicName string, options ...FieldOption) *SchemaBuilder[T] + func (b *SchemaBuilder[T]) Field(publicName string, kind Kind, options ...FieldOption) *SchemaBuilder[T] + func (b *SchemaBuilder[T]) Relation(publicName string, policy NestedPolicy, options ...RelationshipOption) *SchemaBuilder[T] + type SchemaDescription struct + Fields []FieldDescription + Relationships []RelationshipDescription + type SearchFunc func(context.Context, *gorm.DB, string) (*gorm.DB, error) + type Session struct + func (s Session[T]) Apply(ctx context.Context, q Query) (*gorm.DB, error) + func (s Session[T]) List(ctx context.Context, values url.Values) (Page[T], error) + type SortTerm struct + Desc bool + Field string + Source Span + type Span struct + End int + Start int + type UUIDValue string