Versions in this module Expand all Collapse all v0 v0.0.2 Nov 9, 2022 Changes in this version + func Annotation(annot schema.Annotation) (ast.Expr, bool, error) + func Edge(desc *edge.Descriptor) (*ast.CallExpr, error) + func Field(desc *field.Descriptor) (*ast.CallExpr, error) + func Index(desc *index.Descriptor) (*ast.CallExpr, error) + func Mutate(ctx *Context, mutations ...Mutator) error + type Annotator func(schema.Annotation) (ast.Expr, bool, error) + type Context struct + SchemaPackage *packages.Package + func Load(path string) (*Context, error) + func (c *Context) AddType(typeName string) error + func (c *Context) AppendEdge(typeName string, desc *edge.Descriptor) error + func (c *Context) AppendField(typeName string, desc *field.Descriptor) error + func (c *Context) AppendIndex(typeName string, idx ent.Index) error + func (c *Context) AppendTypeAnnotation(typeName string, annot schema.Annotation) error + func (c *Context) HasType(typeName string) bool + func (c *Context) Print(path string, opts ...PrintOption) error + func (c *Context) RemoveEdge(typeName string, edgeName string) error + func (c *Context) RemoveField(typeName string, fieldName string) error + func (c *Context) RemoveType(typeName string) error + type Mutator interface + Mutate func(ctx *Context) error + type PrintOption func(opt *printOpts) + func Header(c string) PrintOption + type UnsupportedAnnotationError struct + func (e *UnsupportedAnnotationError) Error() string + type UpsertSchema struct + Annotations []schema.Annotation + Edges []ent.Edge + Fields []ent.Field + Indexes []ent.Index + Name string + func (u *UpsertSchema) Mutate(ctx *Context) error