parser

package
v0.0.0-...-9a553cb Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldInfo

type FieldInfo struct {
	Name         string // 字段名
	Type         string // 字段类型
	IsNull       bool   // 是否允许NULL
	DefaultValue string // 默认值
	Comment      string // 注释
	IsPrimary    bool   // 是否主键
	IsAutoInc    bool   // 是否自增
}

FieldInfo 字段信息

type SQLParser

type SQLParser struct{}

SQLParser SQL解析器

func NewSQLParser

func NewSQLParser() *SQLParser

NewSQLParser 创建新的SQL解析器

func (*SQLParser) Parse

func (p *SQLParser) Parse(sql string) (*TableInfo, error)

Parse 解析SQL语句

type TableInfo

type TableInfo struct {
	Name        string      // 表名
	Comment     string      // 表注释
	Fields      []FieldInfo // 字段列表
	PrimaryKeys []string    // 主键列表
}

TableInfo 表信息

Jump to

Keyboard shortcuts

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