Documentation
¶
Index ¶
- Variables
- type Col
- type Constrain
- type ConstrainType
- func (v ConstrainType) ConstValues() []enum.IntStringerEnum
- func (v ConstrainType) Int() int
- func (v ConstrainType) Label() string
- func (v ConstrainType) MarshalText() ([]byte, error)
- func (v *ConstrainType) Scan(src interface{}) error
- func (v ConstrainType) String() string
- func (v ConstrainType) Tag(driver string, value interface{}) string
- func (v ConstrainType) TypeName() string
- func (v *ConstrainType) UnmarshalText(data []byte) error
- func (v ConstrainType) Value() (driver.Value, error)
- type Datatype
- func (d *Datatype) CodeGenType(f *codegen.File) codegen.SnippetType
- func (v Datatype) ConstValues() []enum.IntStringerEnum
- func (v Datatype) Int() int
- func (v Datatype) Label() string
- func (v Datatype) MarshalText() ([]byte, error)
- func (v *Datatype) Scan(src interface{}) error
- func (v Datatype) String() string
- func (v Datatype) TypeName() string
- func (v *Datatype) UnmarshalText(data []byte) error
- func (v Datatype) Value() (driver.Value, error)
- type Def
- type DefType
- func (v DefType) ConstValues() []enum.IntStringerEnum
- func (v DefType) Int() int
- func (v DefType) Label() string
- func (v DefType) MarshalText() ([]byte, error)
- func (v *DefType) Scan(src interface{}) error
- func (v DefType) String() string
- func (v DefType) TypeName() string
- func (v *DefType) UnmarshalText(data []byte) error
- func (v DefType) Value() (driver.Value, error)
- type Schema
- func (c *Schema) Comments() map[string][]string
- func (c *Schema) File(name string) *g.File
- func (c *Schema) SchemaName() string
- func (c *Schema) SnippetSchema(f *g.File) g.Snippet
- func (c *Schema) SnippetStruct(comments map[string][]string) map[string]g.Snippet
- func (c *Schema) WriteSchema(root string) error
- func (c *Schema) WriteTables(root string) error
- type Table
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidConstrainType = errors.New("invalid ConstrainType type")
View Source
var InvalidDatatype = errors.New("invalid Datatype type")
View Source
var InvalidDefType = errors.New("invalid DefType type")
View Source
var PkgTypes = "github.com/machinefi/w3bstream/pkg/depends/base/types"
Functions ¶
This section is empty.
Types ¶
type Col ¶
type Col struct {
Name string `json:"name"`
Type Datatype `json:"type"`
Constraints []Constrain `json:"constraints"`
Comment string `json:"comment"`
}
func (*Col) ColumnName ¶
type Constrain ¶
type Constrain struct {
Type ConstrainType `json:"type"`
Value interface{} `json:"value"`
}
type ConstrainType ¶
type ConstrainType int8
const ( CONSTRAIN_TYPE_UNKNOWN ConstrainType = iota CONSTRAIN_TYPE__AUTOINCREMENT CONSTRAIN_TYPE__NOT_NULL CONSTRAIN_TYPE__DEFAULT )
func ParseConstrainTypeFromLabel ¶
func ParseConstrainTypeFromLabel(s string) (ConstrainType, error)
func ParseConstrainTypeFromString ¶
func ParseConstrainTypeFromString(s string) (ConstrainType, error)
func (ConstrainType) ConstValues ¶
func (v ConstrainType) ConstValues() []enum.IntStringerEnum
func (ConstrainType) Int ¶
func (v ConstrainType) Int() int
func (ConstrainType) Label ¶
func (v ConstrainType) Label() string
func (ConstrainType) MarshalText ¶
func (v ConstrainType) MarshalText() ([]byte, error)
func (*ConstrainType) Scan ¶
func (v *ConstrainType) Scan(src interface{}) error
func (ConstrainType) String ¶
func (v ConstrainType) String() string
func (ConstrainType) Tag ¶
func (v ConstrainType) Tag(driver string, value interface{}) string
func (ConstrainType) TypeName ¶
func (v ConstrainType) TypeName() string
func (*ConstrainType) UnmarshalText ¶
func (v *ConstrainType) UnmarshalText(data []byte) error
type Datatype ¶
type Datatype uint8
func ParseDatatypeFromLabel ¶
func ParseDatatypeFromString ¶
func (*Datatype) CodeGenType ¶
func (d *Datatype) CodeGenType(f *codegen.File) codegen.SnippetType
func (Datatype) ConstValues ¶
func (v Datatype) ConstValues() []enum.IntStringerEnum
func (Datatype) MarshalText ¶
func (*Datatype) UnmarshalText ¶
type DefType ¶
type DefType int8
func ParseDefTypeFromLabel ¶
func ParseDefTypeFromString ¶
func (DefType) ConstValues ¶
func (v DefType) ConstValues() []enum.IntStringerEnum
func (DefType) MarshalText ¶
func (*DefType) UnmarshalText ¶
type Schema ¶
type Schema struct {
Project string
Version string
Tables []Table
// contains filtered or unexported fields
}
func LoadConfigFrom ¶
func (*Schema) SchemaName ¶
func (*Schema) SnippetStruct ¶
func (*Schema) WriteSchema ¶
func (*Schema) WriteTables ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.