ast

package
v0.0.0-...-82233a1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToInt

func ToInt(token Token) *int

Types

type Ast

type Ast struct {
	SQL        string
	Statements []string
	Database   *Database
}

type Column

type Column struct {
	Name            string
	DataType        string
	Length          *int
	Precision       *int
	Scale           *int
	NotNull         bool
	AutoIncrement   bool
	PrimaryKey      bool
	ForeignKey      bool
	Unique          bool
	Unsigned        bool
	Zerofill        bool
	UpdateTimestamp bool
	Default         string
	Comment         string
}

type Database

type Database struct {
	Name   string
	Tables []*Table
}

type Index

type Index struct {
	Name    string
	Columns []string
}

type Table

type Table struct {
	Database        string
	Name            string
	Comment         string
	CreateStatement bool
	AlterStatement  bool
	Columns         []*Column
	Indexes         []*Index
}

type Token

type Token struct {
	Type    lexer.TokenType
	Literal string
}

type Tokenizer

type Tokenizer struct {
	Tokens []Token
	// contains filtered or unexported fields
}

func NewTokenizer

func NewTokenizer(tokens []Token) *Tokenizer

func (*Tokenizer) HasNext

func (t *Tokenizer) HasNext() bool

func (*Tokenizer) HasNotNext

func (t *Tokenizer) HasNotNext() bool

func (*Tokenizer) Next

func (t *Tokenizer) Next() Token

func (*Tokenizer) Peek

func (t *Tokenizer) Peek() Token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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