Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnInfo ¶
type ColumnInfo struct {
// contains filtered or unexported fields
}
ColumnInfo is a sql col with options.
func (*ColumnInfo) NameExpr ¶
func (c *ColumnInfo) NameExpr() *ast.ColumnNameExpr
NameExpr - of the col.
type GoType ¶
type GoType struct {
Type GoTypeName
NotNull bool
}
GoType is the type that can be used in golang.
type GoTypeName ¶
type GoTypeName = string
GoTypeName is the name of the type that can be used in golang.
const ( // GoTypeInt int64 GoTypeInt GoTypeName = "int64" // GoTypeFloat64 float64 GoTypeFloat64 GoTypeName = "float64" // GoTypeString string GoTypeString GoTypeName = "string" // GoTypeTime time GoTypeTime GoTypeName = "time" // GoTypeBool bool GoTypeBool GoTypeName = "bool" // GoTypeJson json.RawMessage GoTypeJson GoTypeName = "RawMessage" )
func EvalTypeToGoTypeName ¶
func EvalTypeToGoTypeName(t *types.FieldType) GoTypeName
EvalTypeToGoTypeName - eval
type IndexInfo ¶ added in v0.4.1
type IndexInfo struct {
// contains filtered or unexported fields
}
IndexInfo holds index info of SQL table.
func (*IndexInfo) IsPrimaryKey ¶ added in v0.4.1
type SQLColumn ¶
type SQLColumn interface {
Name() string
NameExpr() *ast.ColumnNameExpr
NotNull() bool
Type() *types.FieldType
GoType() GoType
}
SQLColumn is a sql defined column, immutable.
type SQLTable ¶
type SQLTable interface {
Name() string
Valid() error
StarColumns() []SQLColumn
Columns() []SQLColumn
Indexes() []SQLIndex
SQL() string
}
SQLTable represents a sql table schema, immutable.
func NewTableInfo ¶
func NewTableInfo(s *ast.CreateTableStmt, hiddenFields []string) SQLTable
NewTableInfo -
Click to show internal directories.
Click to hide internal directories.