parser

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package parser 封装 TiDB SQL 解析器,提供 VDS SQL 层使用的 AST 类型。

M1 只支持单语句解析,不支持多语句批量解析。 底层使用 github.com/pingcap/tidb/pkg/parser(ADR-004)。

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 SQL 解析器封装

func New

func New() *Parser

New 创建 Parser 实例

func (*Parser) Parse

func (p *Parser) Parse(sql string) (Statement, error)

Parse 解析单条 SQL 语句,返回 AST 节点。 空语句或多语句输入返回错误。

type Statement

type Statement = ast.StmtNode

Statement TiDB AST 节点别名(上层包直接使用,无需引入 tidb/parser)

Jump to

Keyboard shortcuts

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