Documentation ¶
Index ¶
Constants ¶
const ( DBOptNone = iota DBOptCharset DBOptCollate )
DB Options.
const ( ConstrNoConstr = iota ConstrPrimaryKey ConstrForeignKey ConstrNotNull ConstrAutoIncrement ConstrDefaultValue ConstrUniq ConstrIndex ConstrUniqIndex ConstrKey ConstrUniqKey ConstrNull ConstrOnUpdate ConstrFulltext )
Constraints.
const ( TblOptNone = iota TblOptEngine TblOptCharset TblOptCollate TblOptAutoIncrement )
Table Options.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CharsetOpt ¶
CharsetOpt is used for parsing charset option from SQL.
func (*CharsetOpt) String ¶
func (o *CharsetOpt) String() string
String implements fmt.Stringer interface.
type ColumnDef ¶
type ColumnDef struct { Name string Tp *types.FieldType Constraints []*ConstraintOpt }
ColumnDef is used for parsing column definition from SQL.
type ConstraintOpt ¶
type ConstraintOpt struct { Tp int Bvalue bool Evalue expression.Expression }
ConstraintOpt is used for parsing column constraint info from SQL.
func (*ConstraintOpt) String ¶
func (c *ConstraintOpt) String() string
String implements fmt.Stringer interface.
type DatabaseOpt ¶
DatabaseOpt is used for parsing database option from SQL.
type FloatOpt ¶
FloatOpt is used for parsing floating-point type option from SQL. TODO: add reference doc.
type IndexColName ¶
IndexColName is used for parsing index column name from SQL.
func (*IndexColName) String ¶
func (icn *IndexColName) String() string
String implements fmt.Stringer interface.
type ReferenceDef ¶
type ReferenceDef struct { TableIdent table.Ident IndexColNames []*IndexColName }
ReferenceDef is used for parsing foreign key reference option from SQL. See: http://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html
func (*ReferenceDef) Clone ¶
func (rd *ReferenceDef) Clone() *ReferenceDef
Clone clones a new ReferenceDef from old ReferenceDef.
func (*ReferenceDef) String ¶
func (rd *ReferenceDef) String() string
String implements fmt.Stringer interface.
type TableConstraint ¶
type TableConstraint struct { Tp int ConstrName string // Used for PRIMARY KEY, UNIQUE, ...... Keys []*IndexColName // Used for foreign key. Refer *ReferenceDef }
TableConstraint is constraint for table definition.
func ColumnDefToCol ¶
ColumnDefToCol converts converts ColumnDef to Col and TableConstraints.
func (*TableConstraint) Clone ¶
func (tc *TableConstraint) Clone() *TableConstraint
Clone clones a new TableConstraint from old TableConstraint.
func (*TableConstraint) String ¶
func (tc *TableConstraint) String() string
String implements fmt.Stringer interface.
type TableOption ¶
type TableOption struct { Engine string Charset string Collate string AutoIncrement uint64 // TODO: apply this value to autoid.Allocator. }
TableOption is the collection of table options. TODO: rename TableOpt or TableOption.
func (*TableOption) String ¶
func (o *TableOption) String() string
String implements fmt.Stringer interface.