Versions in this module Expand all Collapse all v0 v0.3.0 Jan 13, 2026 v0.2.0 Jan 13, 2026 v0.1.0 Jan 13, 2026 Changes in this version + type BetweenValue struct + High interface{} + Low interface{} + type CompareOp int + const OpArrayContains + const OpBetween + const OpContains + const OpEndsWith + const OpEquals + const OpExact + const OpFuzzy + const OpGreaterThan + const OpGreaterThanOrEqual + const OpILike + const OpIn + const OpIncludes + const OpIsNotNull + const OpIsNull + const OpLessThan + const OpLessThanOrEqual + const OpLike + const OpNotEquals + const OpNotIn + const OpStartsWith + func (op CompareOp) String() string + type CompiledQuery struct + Params []interface{} + SQL string + type Condition struct + Field string + Nested *WhereClause + Not bool + Operator CompareOp + SubQuery *Query + Value interface{} + type DB interface + ExecContext func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + QueryContext func(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + QueryRowContext func(ctx context.Context, query string, args ...interface{}) *sql.Row + type EntityMeta struct + Columns map[string]string + JSONColumns map[string]bool + PrimaryKey string + Relations map[string]*RelationMeta + SoftDelete string + TSVColumns map[string]string + TableName string + type ErrorType int + const ErrorCompiler + const ErrorExecution + const ErrorLexer + const ErrorParser + const ErrorSemantic + func (et ErrorType) String() string + type Executor struct + func NewExecutor(db DB, entities map[string]*EntityMeta) *Executor + func (e *Executor) Execute(ctx context.Context, q *Query) ([]map[string]interface{}, error) + func (e *Executor) ExecuteAggregate(ctx context.Context, q *Query) (interface{}, error) + func (e *Executor) ExecuteCount(ctx context.Context, q *Query) (int64, error) + func (e *Executor) ExecuteDelete(ctx context.Context, q *Query) (int64, error) + func (e *Executor) ExecuteOne(ctx context.Context, q *Query) (map[string]interface{}, error) + func (e *Executor) ExecuteString(ctx context.Context, queryStr string) ([]map[string]interface{}, error) + func (e *Executor) ExecuteUpdate(ctx context.Context, q *Query) (int64, error) + type Lexer struct + func NewLexer(input string) *Lexer + func (l *Lexer) Tokenize() ([]Token, error) + type LogicalOp int + const LogicalAnd + const LogicalOr + func (op LogicalOp) String() string + type OrderClause struct + Direction OrderDirection + Field string + type OrderDirection int + const OrderAsc + const OrderDesc + func (od OrderDirection) String() string + type Parameter struct + Name string + type Parser struct + func NewParser(tokens []Token) *Parser + func (p *Parser) Parse() (*Query, error) + type Position struct + Column int + Line int + Offset int + func (p Position) IsValid() bool + func (p Position) String() string + type Query struct + AggField string + Entity string + Fields []string + GroupBy []string + Having *WhereClause + Include []string + Limit *int + Offset *int + OrderBy []OrderClause + Type QueryType + Updates []UpdateSet + Where *WhereClause + func Parse(input string) (*Query, error) + func ParseSimple(input string) (*Query, error) + type QueryBuilder struct + func Count(entity string) *QueryBuilder + func Delete(entity string) *QueryBuilder + func Select(entity string) *QueryBuilder + func Update(entity string) *QueryBuilder + func (qb *QueryBuilder) Build() *Query + func (qb *QueryBuilder) Decrement(field string, value interface{}) *QueryBuilder + func (qb *QueryBuilder) Execute(ctx context.Context, exec *Executor) ([]map[string]interface{}, error) + func (qb *QueryBuilder) ExecuteOne(ctx context.Context, exec *Executor) (map[string]interface{}, error) + func (qb *QueryBuilder) Fields(fields ...string) *QueryBuilder + func (qb *QueryBuilder) Include(relations ...string) *QueryBuilder + func (qb *QueryBuilder) Increment(field string, value interface{}) *QueryBuilder + func (qb *QueryBuilder) Limit(limit int) *QueryBuilder + func (qb *QueryBuilder) Offset(offset int) *QueryBuilder + func (qb *QueryBuilder) OrderBy(field string, direction OrderDirection) *QueryBuilder + func (qb *QueryBuilder) Set(field string, value interface{}) *QueryBuilder + func (qb *QueryBuilder) Where(field string, op CompareOp, value interface{}) *QueryBuilder + func (qb *QueryBuilder) WhereClause(where *WhereClause) *QueryBuilder + type QueryError struct + Message string + Position Position + Token *Token + Type ErrorType + func ErrInvalidLimit(value string) *QueryError + func ErrInvalidOffset(value string) *QueryError + func ErrInvalidOperator(tok Token) *QueryError + func ErrInvalidQueryType(queryType QueryType) *QueryError + func ErrInvalidValue(tok Token, expected string) *QueryError + func ErrMissingEntity() *QueryError + func ErrNestedGroupDepth(maxDepth int) *QueryError + func ErrTypeMismatch(field, expectedType, gotType string) *QueryError + func ErrUnexpectedEOF(expected string) *QueryError + func ErrUnexpectedToken(tok Token, expected string) *QueryError + func ErrUnknownEntity(name string) *QueryError + func ErrUnknownField(entity, field string) *QueryError + func NewCompilerError(message string) *QueryError + func NewCompilerErrorWithPosition(pos Position, message string) *QueryError + func NewExecutionError(message string) *QueryError + func NewLexerError(pos Position, message string) *QueryError + func NewLexerErrorWithToken(tok Token, message string) *QueryError + func NewParserError(pos Position, message string) *QueryError + func NewParserErrorWithToken(tok Token, message string) *QueryError + func NewSemanticError(pos Position, message string) *QueryError + func (e *QueryError) Error() string + func (e *QueryError) Unwrap() error + type QueryErrors struct + Errors []*QueryError + func NewQueryErrors() *QueryErrors + func (qe *QueryErrors) Add(err *QueryError) + func (qe *QueryErrors) Error() string + func (qe *QueryErrors) HasErrors() bool + func (qe *QueryErrors) Unwrap() []error + type QueryType int + const QueryAvg + const QueryCount + const QueryDelete + const QueryMax + const QueryMin + const QuerySelect + const QuerySum + const QueryUpdate + func (qt QueryType) String() string + type RelationMeta struct + Entity string + ForeignKey string + InverseColumn string + JoinColumn string + JoinTable string + Type RelationType + type RelationType int + const RelationBelongsTo + const RelationHasMany + const RelationHasOne + const RelationManyToMany + func (rt RelationType) String() string + type SQLCompiler struct + func NewSQLCompiler(entities map[string]*EntityMeta) *SQLCompiler + func (c *SQLCompiler) Compile(q *Query) (*CompiledQuery, error) + type Token struct + Column int + Line int + Pos int + Type TokenType + Value string + func (t Token) String() string + type TokenType int + const TokenAnd + const TokenAsc + const TokenAvg + const TokenBetween + const TokenBy + const TokenColon + const TokenComma + const TokenContains + const TokenCount + const TokenDelete + const TokenDesc + const TokenDot + const TokenEOF + const TokenEndsWith + const TokenEquals + const TokenError + const TokenFalse + const TokenFrom + const TokenGreater + const TokenGreaterEq + const TokenGroup + const TokenGroupBy + const TokenHaving + const TokenILike + const TokenIdent + const TokenIn + const TokenInclude + const TokenIs + const TokenLBracket + const TokenLParen + const TokenLess + const TokenLessEq + const TokenLike + const TokenLimit + const TokenMax + const TokenMin + const TokenNot + const TokenNotEquals + const TokenNull + const TokenNumber + const TokenOffset + const TokenOr + const TokenOrder + const TokenParam + const TokenRBracket + const TokenRParen + const TokenSelect + const TokenSet + const TokenStartsWith + const TokenString + const TokenSum + const TokenTilde + const TokenTrue + const TokenUpdate + const TokenWhere + const TokenWith + type UpdateOp int + const UpdateAppend + const UpdateDecrement + const UpdateIncrement + const UpdateRemove + const UpdateSetValue + func (op UpdateOp) String() string + type UpdateSet struct + Field string + Op UpdateOp + Value interface{} + type WhereClause struct + Conditions []Condition + Groups []*WhereClause + Operator LogicalOp