parser

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package parser provides a recursive descent SQL parser that converts tokens into an Abstract Syntax Tree (AST). It supports comprehensive SQL features including SELECT, INSERT, UPDATE, DELETE, DDL operations, Common Table Expressions (CTEs), and set operations (UNION, EXCEPT, INTERSECT).

Phase 2 Features (v1.2.0+):

  • Common Table Expressions (WITH clause) with recursive support
  • Set operations: UNION, UNION ALL, EXCEPT, INTERSECT
  • Multiple CTE definitions in single query
  • CTE column specifications
  • Left-associative set operation parsing
  • Integration of CTEs with set operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser represents a SQL parser

func NewParser

func NewParser() *Parser

NewParser creates a new parser

func (*Parser) Parse

func (p *Parser) Parse(tokens []token.Token) (*ast.AST, error)

Parse parses the tokens into an AST

func (*Parser) Release

func (p *Parser) Release()

Release releases any resources held by the parser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL