entry

package
v2.0.0-...-59a803e 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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TINYINT   = ColumnType("TINYINT")
	SMALLINT  = ColumnType("SMALLINT")
	MEDIUMINT = ColumnType("MEDIUMINT")
	INT       = ColumnType("INT")
	INTEGER   = ColumnType("INTEGER")
	BIGINT    = ColumnType("BIGINT")
	FLOAT     = ColumnType("FLOAT")
	DOUBLE    = ColumnType("DOUBLE")
	DECIMAL   = ColumnType("DECIMAL")
	BOOLEAN   = ColumnType("BOOLEAN")

	DATE      = ColumnType("DATE")
	TIME      = ColumnType("TIME")
	YEAR      = ColumnType("YEAR")
	DATETIME  = ColumnType("DATETIME")
	TIMESTAMP = ColumnType("TIMESTAMP")

	CHAR       = ColumnType("CHAR")
	NCHAR      = ColumnType("NCHAR")
	VARCHAR    = ColumnType("VARCHAR")
	NVARCHAR   = ColumnType("NVARCHAR")
	TINYBLOB   = ColumnType("TINYBLOB")
	TINYTEXT   = ColumnType("TINYTEXT")
	BLOB       = ColumnType("BLOB")
	TEXT       = ColumnType("TEXT")
	MEDIUMBLOB = ColumnType("MEDIUMBLOB")
	MEDIUMTEXT = ColumnType("MEDIUMTEXT")
	LONGBLOB   = ColumnType("LONGBLOB")
	LONGTEXT   = ColumnType("LONGTEXT")
	JSON       = ColumnType("JSON")
)
View Source
const (
	SelectQueryKind = QueryKind("SELECT")
	InsertQueryKind = QueryKind("INSERT")
	UpdateQueryKind = QueryKind("UPDATE")
	DeleteQueryKind = QueryKind("DELETE")
)

Variables

View Source
var ColumnTypeMappings []*ColumnTypeMapping

Functions

func OverrideColumnTypeMappings

func OverrideColumnTypeMappings(columnType string, nullable bool, goType string)

func QueryMergeCond

func QueryMergeCond(root *Query, sub *Query)

mer

Types

type Change

type Change struct {
	Kind      ChangeKind
	TableName string
	Source    string
	Target    string
}

RENAME source="" target=new_table_name ADD source="" target=new_column_name type MODIFY(ALTER COLUMN) source="old_col" target=new_col type CHANGE source="old_col" target=new_col type DROP(DROP COLUMN)

type ChangeKind

type ChangeKind string

type Column

type Column struct {
	Name          string
	Type          ColumnType
	Null          bool
	GoName        string
	GoType        *GoType
	DefaultValue  string
	AutoIncrement bool
}

func (*Column) MappingGoType

func (c *Column) MappingGoType() (ok bool)

type ColumnType

type ColumnType string

func NewColumnType

func NewColumnType(v string) (columnType ColumnType, err error)

type ColumnTypeMapping

type ColumnTypeMapping struct {
	ColumnType ColumnType
	GoType     *GoType
	NullAble   bool
}

type CondExpr

type CondExpr struct {
	Table               QueryTable
	ColumnQualifierName string // table or table as
	ColumnName          string // column or name as
	PlaceHolder         string
	Args                []string
	Name                string
	GoType              *GoType
	IsArg               bool
}

func (*CondExpr) BuildName

func (e *CondExpr) BuildName()

type CondExprList

type CondExprList struct {
	ExprList []*CondExpr
}

type GoType

type GoType struct {
	Package string
	Name    string
}

func NewGoType

func NewGoType(v string) *GoType

type Query

type Query struct {
	RawName        string
	Sql            string
	Kind           QueryKind
	Name           string
	TableList      []*QueryTable
	SelectExprList *SelectExprList
	CondExprList   *CondExprList
	// contains filtered or unexported fields
}

func NewQuery

func NewQuery() *Query

func QueryFill

func QueryFill(tables []*Table, queries0 []*Query) (queries []*Query, err error)

func (*Query) Fill

func (q *Query) Fill()

type QueryExpr

type QueryExpr struct {
	Table               QueryTable
	ColumnQualifierName string // table or table as
	ColumnName          string // column or name as
	FuncName            string
	Name                string
	GoType              *GoType
}

func (*QueryExpr) BuildName

func (e *QueryExpr) BuildName()

type QueryKind

type QueryKind string

type QueryTable

type QueryTable struct {
	Schema string
	Table  string
	NameAs string
	Ref    *Table
}

type Schema

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

type SelectExprList

type SelectExprList struct {
	ExprList []*QueryExpr
}

type Table

type Table struct {
	FullName string
	Schema   string
	Name     string
	GoName   string
	PKs      []string
	Columns  []*Column
}

Jump to

Keyboard shortcuts

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