Versions in this module Expand all Collapse all v1 v1.0.0 Nov 15, 2023 Changes in this version + func BoolExpr(l *Lexer, be *BooleanExpression) bool + func ColumnOrGroup(l *Lexer, stmt *Statement) bool + func CompExpr(l *Lexer, be *BooleanExpression) bool + func FromStmt(l *Lexer, stmt *Statement) bool + func GetValue(s string) any + func InCompExpr(l *Lexer, be *BooleanExpression, id string) bool + func OptJoinStmt(l *Lexer, stmt *Statement) bool + func OptWhereStmt(l *Lexer, stmt *Statement) bool + func SelectStmt(l *Lexer, stmt *Statement) bool + func SimpleCompExpr(l *Lexer, be *BooleanExpression, id string) bool + type BooleanComposite struct + BoolOp string + SubExpr []BooleanExpression + func (bc *BooleanComposite) GetBson(tableFrom, tableJoin string) (bson.D, error) + type BooleanExpression interface + GetBson func(tableFrom, tableJoin string) (bson.D, error) + func ParseBoolExpr(sql string) (BooleanExpression, error) + type Column struct + GroupFunction string + Name string + type Comparision struct + Id string + Op string + Value any + func (c *Comparision) GetBson(tableFrom, tableJoin string) (bson.D, error) + type EmptyComparision struct + func (e EmptyComparision) GetBson(_, _ string) (bson.D, error) + type InComparision struct + Id string + Not bool + Values []any + func (ic *InComparision) GetBson(tableFrom, tableJoin string) (bson.D, error) + type Lexer struct + Token rune + Value string + func NewLexer(rd io.Reader) *Lexer + func (l *Lexer) Lex() bool + type Statement struct + FromTable string + JoinFromAttr string + JoinTable string + JoinToAttr string + SelectColumn []Column + Where BooleanExpression + func Parse(sql string) (*Statement, error) + func (stmt *Statement) GetGroup() (bson.D, error) + func (stmt *Statement) GetLookup() (bson.D, error) + func (stmt *Statement) GetSelect() (bson.D, error) + func (stmt *Statement) IsAggregate() bool + func (stmt *Statement) ToMongoAggregate() (mongo.Pipeline, error) + func (stmt *Statement) ToMongoFind() (bson.D, bson.D, error)