Versions in this module Expand all Collapse all v0 v0.1.10 Dec 11, 2024 v0.1.9 Nov 10, 2024 v0.1.8 Nov 10, 2024 v0.1.7 Nov 10, 2024 Changes in this version + func SnakeCase(inputString string) string v0.1.6 Nov 10, 2024 Changes in this version + func ToSnakeCaseSpecialFromCamel(input_string string) string v0.1.5 Nov 10, 2024 v0.1.4 Nov 10, 2024 v0.1.3 Nov 10, 2024 v0.1.2 Nov 10, 2024 v0.1.1 Nov 9, 2024 v0.1.0 Nov 9, 2024 Changes in this version + var AllFeatures = []Feature + var FeatureBidiEdgeRefs = Feature + var FeatureEntQL = Feature + var FeatureExecQuery = Feature + var FeatureIntercept = Feature + var FeatureLock = Feature + var FeatureModifier = Feature + var FeatureNamedEdges = Feature + var FeaturePrivacy = Feature + var FeatureSchemaConfig = Feature + var FeatureSnapshot = Feature + var FeatureUpsert = Feature + var FeatureVersionedMigration = Feature + var Funcs = template.FuncMap + var GraphTemplates = []GraphTemplate + var Templates = []TypeTemplate + func AddAcronym(word string) + func PrepareEnv(c *Config) (undo func() error, err error) + func ValidSchemaName(name string) error + type Annotations map[string]any + func (a *Annotations) Set(k string, v any) + type Config struct + Annotations Annotations + BuildFlags []string + 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 Dependencies []*Dependency + func (Dependencies) Name() string + func (d Dependencies) Merge(other schema.Annotation) schema.Annotation + type Dependency struct + Field string + Option string + Type *field.TypeInfo + func (d *Dependency) Build() error + type Edge struct + Annotations Annotations + Bidi bool + Immutable bool + Inverse string + Name string + Optional bool + Owner *Type + Ref *Edge + Rel Relation + StructTag string + Through *Type + Type *Type + Unique bool + func (e *Edge) ForeignKey() (*ForeignKey, error) + func (e *Edge) TableSchema() (string, error) + func (e Edge) BuilderField() string + func (e Edge) ColumnConstant() string + func (e Edge) Comment() string + func (e Edge) Constant() string + func (e Edge) EagerLoadField() string + func (e Edge) EagerLoadNamedField() string + func (e Edge) EntSQL() *fluent_sql.Annotation + func (e Edge) Field() *Field + func (e Edge) HasConstraint() bool + func (e Edge) HasFieldSetter() bool + func (e Edge) Index() (int, error) + 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) OrderCountName() (string, error) + func (e Edge) OrderFieldName() (string, error) + func (e Edge) OrderTermsName() (string, error) + 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() bool + func (f Field) DefaultName() string + func (f Field) DefaultValue() any + func (f Field) DeprecationReason() string + func (f Field) Edge() (*Edge, error) + func (f Field) EntSQL() *fluent_sql.Annotation + func (f Field) EnumName(enum string) string + func (f Field) EnumNames() []string + func (f Field) EnumValues() []string + func (f Field) FromValueFunc() (string, error) + func (f Field) HasGoType() bool + func (f Field) HasValueScanner() bool + func (f Field) IsBool() bool + func (f Field) IsBytes() bool + func (f Field) IsDeprecated() bool + func (f Field) IsEdgeField() bool + func (f Field) IsEnum() bool + func (f Field) IsInt() bool + func (f Field) IsInt64() bool + func (f Field) IsJSON() bool + func (f Field) IsOther() bool + func (f Field) IsString() bool + func (f Field) IsTime() bool + func (f Field) IsUUID() bool + func (f Field) MutationAdd() string + func (f Field) MutationAddAssignExpr(ident1, ident2 string) (string, error) + func (f Field) MutationAdded() string + func (f Field) MutationAppend() string + func (f Field) MutationAppended() string + 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) OrderName() string + func (f Field) PK() *schema.Column + func (f Field) RequiredFor() (dialects []string) + func (f Field) ScanType() string + func (f Field) ScanTypeField(rec string) string + func (f Field) ScanValueFunc() (string, error) + func (f Field) Sensitive() bool + func (f Field) SignedType() (*field.TypeInfo, error) + func (f Field) StorageKey() string + func (f Field) StructField() string + func (f Field) SupportsMutationAdd() bool + func (f Field) SupportsMutationAppend() bool + func (f Field) UpdateDefaultName() string + func (f Field) Validator() string + func (f Field) ValueFunc() (string, error) + 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) MutableNodes() []*Type + func (g *Graph) SchemaSnapshot() (string, error) + func (g *Graph) SupportMigrate() bool + func (g *Graph) TableSchemas() ([]string, error) + func (g *Graph) Tables() (all []*schema.Table, err error) + func (g *Graph) Views() (views []*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 + Init func(*Graph) error + 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) ParseFS(fsys fs.FS, patterns ...string) (*Template, error) + func (t *Template) ParseFiles(filenames ...string) (*Template, error) + func (t *Template) ParseGlob(pattern string) (*Template, error) + func (t *Template) SkipIf(cond func(*Graph) bool) *Template + type Type struct + Annotations Annotations + EdgeSchema 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) TableSchema() (string, error) + func (t Type) ClientName() string + func (t Type) CreateBulReceiver() string + func (t Type) CreateBulkName() string + func (t Type) CreateName() string + func (t Type) CreateReceiver() string + func (t Type) DeleteName() string + func (t Type) DeleteOneName() string + func (t Type) DeleteOneReceiver() string + func (t Type) DeleteReceiver() string + func (t Type) DeprecatedFields() []*Field + func (t Type) EdgesWithID() (edges []*Edge) + func (t Type) EntSQL() *fluent_sql.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) HasCompositeID() bool + func (t Type) HasDefault() bool + func (t Type) HasNumeric() bool + func (t Type) HasOneFieldID() bool + func (t Type) HasOptional() bool + func (t Type) HasUpdateCheckers() bool + func (t Type) HasUpdateDefault() bool + func (t Type) HasValidators() bool + func (t Type) HasValueScanner() bool + func (t Type) HookPositions() []*load.Position + func (t Type) ImmutableFields() []*Field + func (t Type) InterceptorPositions() []*load.Position + func (t Type) IsEdgeSchema() bool + func (t Type) IsView() bool + func (t Type) Label() string + func (t Type) MixedInFields() []int + func (t Type) MixedInHooks() []int + func (t Type) MixedInInterceptors() []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) NumInterceptors() int + func (t Type) NumM2M() int + func (t Type) NumMixin() int + func (t Type) NumPolicy() int + func (t Type) Package() string + func (t Type) PackageAlias() string + func (t Type) PackageDir() 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() []struct{ ... } + func (t Type) Table() string + func (t Type) TagTypes() []string + func (t Type) TypeName() string + func (t Type) UnexportedForeignKeys() []*ForeignKey + func (t Type) UpdateName() string + func (t Type) UpdateOneName() string + func (t Type) UpdateOneReceiver() string + func (t Type) UpdateReceiver() string + func (t Type) ValueName() string + type TypeTemplate struct + Cond func(*Type) bool + ExtendPatterns []string + Format func(*Type) string + Name string