parser

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package parser provides a high-level SQL parser with functional options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Parser)

Option configures a Parser using the functional options pattern.

func WithDebug

func WithDebug(enabled bool) Option

WithDebug enables or disables debug mode for the parser.

func WithMaxErrors

func WithMaxErrors(maxErrors int) Option

WithMaxErrors sets the maximum number of errors to collect before stopping.

type Parser

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

Parser parses SQL DDL statements and produces a schema catalog.

func NewParser

func NewParser(options ...Option) *Parser

NewParser creates a new Parser with the provided functional options.

func (*Parser) Parse

func (p *Parser) Parse(ctx context.Context, input string) (*model.Catalog, error)

Parse parses the provided SQL input and returns a catalog of schema objects. It respects context cancellation and will return an error if the context is cancelled.

Directories

Path Synopsis
Package dialects implements SQL dialect parsers.
Package dialects implements SQL dialect parsers.
Package grammars defines SQL dialect grammars.
Package grammars defines SQL dialect grammars.
languages
graphql
Package graphql implements a GraphQL schema parser.
Package graphql implements a GraphQL schema parser.

Jump to

Keyboard shortcuts

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