func ParseSqlStatements(sqlQuery string) ([]SqlStatement, error) { l := lex.NewSqlLexer(sqlQuery) m := Sqlbridge{l: l, SqlTokenPager: NewSqlTokenPager(l), buildVm: false} stmts := make([]SqlStatement, 0) for { stmt, err := m.parse() if err != nil { return nil, err } stmts = append(stmts, stmt) sqlRemaining, hasMore := l.Remainder() if !hasMore { break } l = lex.NewSqlLexer(sqlRemaining) m = Sqlbridge{l: l, SqlTokenPager: NewSqlTokenPager(l), buildVm: false} } return stmts, nil }
func ParseSqlVm(sqlQuery string) (SqlStatement, error) { l := lex.NewSqlLexer(sqlQuery) m := Sqlbridge{l: l, SqlTokenPager: NewSqlTokenPager(l), buildVm: true} return m.parse() }
func parseSqlResolver(sqlQuery string, fr expr.FuncResolver) (SqlStatement, error) { l := lex.NewSqlLexer(sqlQuery) m := Sqlbridge{l: l, SqlTokenPager: NewSqlTokenPager(l), funcs: fr, buildVm: false} return m.parse() }