Versions in this module Expand all Collapse all v0 v0.8.4 Jul 24, 2021 v0.8.3 Jul 24, 2021 v0.8.2 Jul 22, 2021 v0.8.1 Jul 22, 2021 Changes in this version + var AllFeatures = []Feature + var FeatureEntQL = Feature + var FeatureLock = Feature + var FeatureModifier = Feature + var FeaturePrivacy = Feature + var FeatureSchemaConfig = Feature + var FeatureSnapshot = Feature + var Funcs = template.FuncMap + var GraphTemplates = []GraphTemplate + var Templates = []TypeTemplate + func PrepareEnv(c *Config) (undo func() error, err error) + func ValidSchemaName(name string) error + type Annotations map[string]interface + type Config struct + Annotations Annotations + Features []Feature + Header string + Hooks []Hook + IDType *field.TypeInfo + Package string + Schema string + Storage *Storage + Target string + Templates []*Template + func (Config) ModuleInfo() (m debug.Module) + func (c Config) FeatureEnabled(name string) (bool, error) + type Edge struct + Annotations Annotations + Bidi bool + Inverse string + Name string + Optional bool + Owner *Type + Ref *Edge + Rel Relation + StructTag string + Type *Type + Unique bool + func (e *Edge) ForeignKey() (*ForeignKey, error) + func (e Edge) BuilderField() string + func (e Edge) ColumnConstant() string + func (e Edge) Constant() string + func (e Edge) EagerLoadField() string + func (e Edge) EntSQL() *entsql.Annotation + func (e Edge) Field() *Field + func (e Edge) HasConstraint() bool + func (e Edge) HasFieldSetter() bool + func (e Edge) InverseLabelConstant() string + func (e Edge) InverseTableConstant() string + func (e Edge) IsInverse() bool + func (e Edge) Label() string + func (e Edge) LabelConstant() string + func (e Edge) M2M() bool + func (e Edge) M2O() bool + func (e Edge) MutationAdd() string + func (e Edge) MutationClear() string + func (e Edge) MutationCleared() string + func (e Edge) MutationRemove() string + func (e Edge) MutationReset() string + func (e Edge) MutationSet() string + func (e Edge) O2M() bool + func (e Edge) O2O() bool + func (e Edge) OwnFK() bool + func (e Edge) PKConstant() string + func (e Edge) StorageKey() (*edge.StorageKey, error) + func (e Edge) StructField() string + func (e Edge) TableConstant() string + type Enum struct + Name string + Value string + type Feature struct + Default bool + Description string + GraphTemplates []GraphTemplate + Name string + Stage FeatureStage + Templates []*Template + type FeatureStage int + const Alpha + const Beta + const Experimental + const Stable + type Field struct + Annotations Annotations + Default bool + Enums []Enum + Immutable bool + Name string + Nillable bool + Optional bool + Position *load.Position + StructTag string + Type *field.TypeInfo + Unique bool + UpdateDefault bool + UserDefined bool + Validators int + func (f *Field) Ops() []Op + func (f Field) BasicType(ident string) (expr string) + func (f Field) BuilderField() string + func (f Field) Column() *schema.Column + func (f Field) Comment() string + func (f Field) Constant() string + func (f Field) ConvertedToBasic() bool + func (f Field) DefaultFunc() interface{} + func (f Field) DefaultName() string + func (f Field) DefaultValue() interface{} + func (f Field) Edge() (*Edge, error) + func (f Field) EntSQL() *entsql.Annotation + func (f Field) EnumName(enum string) string + func (f Field) EnumNames() []string + func (f Field) EnumValues() []string + func (f Field) HasGoType() bool + func (f Field) IsBool() bool + func (f Field) IsBytes() bool + func (f Field) IsEdgeField() bool + func (f Field) IsEnum() bool + func (f Field) IsInt() bool + func (f Field) IsJSON() bool + func (f Field) IsString() bool + func (f Field) IsTime() bool + func (f Field) IsUUID() bool + func (f Field) MutationAddAssignExpr(ident1, ident2 string) (string, error) + func (f Field) MutationClear() string + func (f Field) MutationCleared() string + func (f Field) MutationGet() string + func (f Field) MutationGetOld() string + func (f Field) MutationReset() string + func (f Field) MutationSet() string + func (f Field) NewScanType() string + func (f Field) NillableValue() bool + func (f Field) PK() *schema.Column + func (f Field) ScanType() string + func (f Field) ScanTypeField(rec string) string + func (f Field) Sensitive() bool + func (f Field) StorageKey() string + func (f Field) StructField() string + func (f Field) SupportsMutationAdd() bool + func (f Field) UpdateDefaultName() string + func (f Field) Validator() string + type ForeignKey struct + Edge *Edge + Field *Field + UserDefined bool + func (f ForeignKey) StructField() string + type GenerateFunc func(*Graph) error + func (f GenerateFunc) Generate(g *Graph) error + type Generator interface + Generate func(*Graph) error + type Graph struct + Nodes []*Type + Schemas []*load.Schema + func NewGraph(c *Config, schemas ...*load.Schema) (g *Graph, err error) + func (g *Graph) Gen() error + func (g *Graph) SchemaSnapshot() (string, error) + func (g *Graph) SupportMigrate() bool + func (g *Graph) Tables() (all []*schema.Table, err error) + type GraphTemplate struct + ExtendPatterns []string + Format string + Name string + Skip func(*Graph) bool + type Hook func(Generator) Generator + type Index struct + Annotations Annotations + Columns []string + Name string + Unique bool + type Op int + const Contains + const ContainsFold + const EQ + const EqualFold + const GT + const GTE + const HasPrefix + const HasSuffix + const In + const IsNil + const LT + const LTE + const NEQ + const NotIn + const NotNil + func (o Op) Name() string + func (o Op) Niladic() bool + func (o Op) Variadic() bool + type Rel int + const M2M + const M2O + const O2M + const O2O + const Unk + func (r Rel) String() string + type Relation struct + Columns []string + Table string + Type Rel + func (r Relation) Column() string + type SchemaMode uint + const Cascade + const Indexes + const Migrate + const Unique + func (m SchemaMode) Support(mode SchemaMode) bool + type Snapshot struct + Features []string + Package string + Schema string + Schemas []*load.Schema + type Storage struct + Builder reflect.Type + Dialects []string + IdentName string + Imports []string + Name string + OpCode func(Op) string + Ops func(*Field) []Op + SchemaMode SchemaMode + func NewStorage(s string) (*Storage, error) + func (s *Storage) String() string + type Template struct + FuncMap template.FuncMap + func MustParse(t *Template, err error) *Template + func NewTemplate(name string) *Template + func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error) + func (t *Template) Funcs(funcMap template.FuncMap) *Template + func (t *Template) Parse(text string) (*Template, error) + func (t *Template) ParseDir(path string) (*Template, error) + func (t *Template) ParseFiles(filenames ...string) (*Template, error) + func (t *Template) ParseGlob(pattern string) (*Template, error) + type Type struct + Annotations Annotations + Edges []*Edge + Fields []*Field + ForeignKeys []*ForeignKey + ID *Field + Indexes []*Index + Name string + func NewType(c *Config, schema *load.Schema) (*Type, error) + func (t *Type) AddIndex(idx *load.Index) error + func (t Type) CreateBulkName() string + func (t Type) CreateName() string + func (t Type) DeleteName() string + func (t Type) DeleteOneName() string + func (t Type) EntSQL() *entsql.Annotation + func (t Type) EnumFields() []*Field + func (t Type) FKEdges() (edges []*Edge) + func (t Type) FieldBy(fn func(*Field) bool) (*Field, bool) + func (t Type) FilterName() string + func (t Type) HasAssoc(name string) (*Edge, bool) + func (t Type) HasDefault() bool + func (t Type) HasNumeric() bool + func (t Type) HasOptional() bool + func (t Type) HasUpdateCheckers() bool + func (t Type) HasUpdateDefault() bool + func (t Type) HasValidators() bool + func (t Type) HookPositions() []*load.Position + func (t Type) Label() string + func (t Type) MixedInFields() []int + func (t Type) MixedInHooks() []int + func (t Type) MixedInPolicies() []int + func (t Type) MutableFields() []*Field + func (t Type) MutationFields() []*Field + func (t Type) MutationName() string + func (t Type) NumConstraint() int + func (t Type) NumHooks() int + func (t Type) NumM2M() int + func (t Type) NumMixin() int + func (t Type) NumPolicy() int + func (t Type) Package() string + func (t Type) PolicyPositions() []*load.Position + func (t Type) QueryName() string + func (t Type) Receiver() string + func (t Type) RelatedTypes() []*Type + func (t Type) RuntimeMixin() bool + func (t Type) SiblingImports() []string + func (t Type) Table() string + func (t Type) TagTypes() []string + func (t Type) UnexportedForeignKeys() []*ForeignKey + func (t Type) UpdateName() string + func (t Type) UpdateOneName() string + type TypeTemplate struct + ExtendPatterns []string + Format func(*Type) string + Name string