mysql

package
v0.0.0-...-8f588a7 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableDropChangeKind    = "DROP TABLE"
	TableRenameChangeKind  = "RENAME TABLE"
	ColumnAddChangeKind    = "ADD COLUMN"
	ColumnModifyChangeKind = "MODIFY COLUMN"
	ColumnChangeChangeKind = "CHANGE COLUMN"
	ColumnDropChangeKind   = "DROP COLUMN"
)

Variables

This section is empty.

Functions

func ParseMySQLQuery

func ParseMySQLQuery(content string) (queries []*entry.Query, err error)

func ParseMySQLSchema

func ParseMySQLSchema(content string) (schema *entry.Schema, err error)

Types

type ChangDropColumn

type ChangDropColumn struct {
	Name string
}

type ChangDropTable

type ChangDropTable struct{}

type Change

type Change struct {
	Kind    ChangeKind
	Schema  string
	Table   string
	Target  interface{}
	Content string
}

DROP TABLE source="" RENAME TABLE source="" target=new_table_name ADD COLUMN source="" target=new_column_name type MODIFY COLUMN source="old_col" target=type CHANGE COLUMN source="old_col" target=new_col type DROP COLUMN source="old_col"

type ChangeAddColumn

type ChangeAddColumn struct {
	Name         string
	Type         entry.ColumnType
	DefaultValue string
	First        bool
	After        string
}

type ChangeChangeColumn

type ChangeChangeColumn struct {
	Source       string
	Name         string
	Type         entry.ColumnType
	DefaultValue string
}

type ChangeKind

type ChangeKind string

type ChangeModifyColumn

type ChangeModifyColumn struct {
	Source       string
	Type         entry.ColumnType
	DefaultValue string
}

type ChangeRenameTable

type ChangeRenameTable struct {
	Schema string
	Name   string
}

Jump to

Keyboard shortcuts

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