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: 0

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