parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeUnspecified byte = 0
	TypeTiny        byte = 1 // TINYINT
	TypeShort       byte = 2 // SMALLINT
	TypeLong        byte = 3 // INT
	TypeFloat       byte = 4
	TypeDouble      byte = 5
	TypeNull        byte = 6
	TypeTimestamp   byte = 7
	TypeLonglong    byte = 8 // BIGINT
	TypeInt24       byte = 9 // MEDIUMINT
	TypeDate        byte = 10
	/* TypeDuration original name was TypeTime, renamed to TypeDuration to resolve the conflict with Go type Time.*/
	TypeDuration byte = 11
	TypeDatetime byte = 12
	TypeYear     byte = 13
	TypeNewDate  byte = 14
	TypeVarchar  byte = 15
	TypeBit      byte = 16

	TypeJSON       byte = 0xf5
	TypeNewDecimal byte = 0xf6
	TypeEnum       byte = 0xf7
	TypeSet        byte = 0xf8
	TypeTinyBlob   byte = 0xf9
	TypeMediumBlob byte = 0xfa
	TypeLongBlob   byte = 0xfb
	TypeBlob       byte = 0xfc
	TypeVarString  byte = 0xfd
	TypeString     byte = 0xfe
	TypeGeometry   byte = 0xff
)
View Source
const (
	UnsignedFlag uint = 1 << 5 /* Field is unsigned */
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MysqlParser

type MysqlParser struct{}

MysqlParser mysql parser implement

func (*MysqlParser) Name

func (*MysqlParser) Name() string

func (*MysqlParser) Parse

func (*MysqlParser) Parse(ddl string) (table string, fields []schema.Field, err error)

Parse implement parse ddl info

type Parser

type Parser interface {
	// Name parser name
	Name() string
	// Parse parse ddl to table and column info
	Parse(ddl string) (table string, fields []schema.Field, err error)
}

type PostgresqlParser

type PostgresqlParser struct{}

PostgresqlParser postgresql parser implement Note: postgresql ddl not support index and comment and collate https://stackoverflow.com/questions/6239657/can-you-create-an-index-in-the-create-table-definition It's using github.com/auxten/postgresql-parser package which is not support `COLLATE`

func (*PostgresqlParser) Name

func (*PostgresqlParser) Name() string

func (*PostgresqlParser) Parse

func (*PostgresqlParser) Parse(ddl string) (table string, fields []schema.Field, err error)

Parse implement parse ddl info

Jump to

Keyboard shortcuts

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