parser

package
v0.0.1-0...-4535bed Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: PostgreSQL Imports: 6 Imported by: 0

Documentation

Overview

Package parser contains the universal TDOP parser for SQL snippet.

Accepts partial SQL statements like DEFAUT values for columns. Parses a mix of all SQL dialects. Returns a parse tree of nodes from ast.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustParse

func MustParse(sql string, args ...any) ast.Node

MustParse return an AST or panics.

func Parse

func Parse(l *lexer.Lexer) (ast.Node, error)

Parse parses the input and returns a tree of nodes.

func StartTracing

func StartTracing()

StartTracing enables parser event collect.

Use Trace.Events() to get events.

func StopTracing

func StopTracing()

Types

type Logger

type Logger interface {
	// Events return the list of parse trace events.
	Events() []string
	// contains filtered or unexported methods
}

Logger is the interface for the trace logger.

var Trace Logger = &voidLog{}

Trace holds the parser messages.

Use Trace.Events() []string to get events.

Jump to

Keyboard shortcuts

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