Versions in this module Expand all Collapse all v1 v1.5.0 Oct 24, 2022 Changes in this version + var Funcs = template.FuncMap + var GraphTemplates = []GraphTemplate + var Templates = []TypeTemplate + func PrepareEnv(c *Config) (undo func() error, err error) + type Config struct + Header string + IDType *field.TypeInfo + Package string + Schema string + Storage *Storage + Target string + Template *template.Template + func (Config) ModuleInfo() (m debug.Module) + type Edge struct + Annotations map[string]interface{} + Bidi bool + Inverse string + Name string + Optional bool + Owner *Type + Rel Relation + StructTag string + Type *Type + Unique bool + func (e Edge) BuilderField() string + func (e Edge) ColumnConstant() string + func (e Edge) Constant() string + func (e Edge) HasConstraint() 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) MutationReset() string + func (e Edge) O2M() bool + func (e Edge) O2O() bool + func (e Edge) OwnFK() bool + func (e Edge) PKConstant() string + func (e Edge) StructFKField() string + func (e Edge) StructField() string + func (e Edge) TableConstant() string + type Enum struct + Name string + Value string + type Field struct + Annotations map[string]interface{} + 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) BasicType(ident string) (expr string) + func (f Field) BuilderField() string + func (f Field) Column() *schema.Column + func (f Field) Constant() string + func (f Field) ConvertedToBasic() bool + func (f Field) DefaultName() string + func (f Field) DefaultValue() interface{} + 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) 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) MutationGet() string + func (f Field) MutationGetOld() string + func (f Field) MutationReset() string + func (f Field) NullType() string + func (f Field) NullTypeField(rec string) string + func (f Field) PK() *schema.Column + func (f Field) Sensitive() bool + func (f Field) StorageKey() string + func (f Field) StructField() string + func (f Field) UpdateDefaultName() string + func (f Field) Validator() string + type ForeignKey struct + Edge *Edge + Field *Field + type Graph struct + Nodes []*Type + Schemas []*load.Schema + func NewGraph(c *Config, schemas ...*load.Schema) (g *Graph, err error) + func (g *Graph) Gen() (err error) + func (g *Graph) SupportMigrate() bool + func (g *Graph) Tables() (all []*schema.Table) + type GraphTemplate struct + Format string + Name string + Skip func(*Graph) bool + type Index struct + 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 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 Type struct + 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) EnumFields() []*Field + func (t Type) FKEdges() (edges []*Edge) + 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) HasPolicy() 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) MutableFields() []*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) Package() string + 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) UpdateName() string + func (t Type) UpdateOneName() string + type TypeTemplate struct + ExtendPattern string + Format func(*Type) string + Name string + func (t TypeTemplate) Match(name string) bool