Versions in this module Expand all Collapse all v1 v1.5.3 Jun 12, 2021 v1.5.2 Apr 22, 2021 v1.5.1 Jan 27, 2021 Changes in this version + const ColumnEsc + const SchemaEsc + const TableEsc + var IndexChopSuffixRE = regexp.MustCompile(`(?i)_(ix|idx|index|pkey|ukey|key)$`) + var IntRE = regexp.MustCompile(`^int(32|64)?$`) + var PrecScaleRE = regexp.MustCompile(`\(([0-9]+)(\s*,[0-9]+)?\)$`) + var SchemaLoaders = map[string]Loader + var XoConfig xoConfigType + func GenRandomID() string + func NullBoolToBool(b *bool, defaultValue bool) bool + func SingularizeIdentifier(s string) string + type ArgType struct + Append bool + CustomTypePackage string + DB *sql.DB + DSN string + EnablePostgresOIDs bool + EntitiesPkg string + EscapeAll bool + EscapeColumnNames bool + EscapeSchemaName bool + EscapeTableNames bool + Filename string + ForeignKeyMode *FkMode + Generated []TBuf + IgnoreFields []string + Int32Type string + KnownTypeMap map[string]bool + Loader Loader + LoaderType string + NameConflictSuffix string + Out string + Package string + Path string + Query string + QueryAllowNulls bool + QueryFields string + QueryFunc string + QueryFuncComment string + QueryInterpolate bool + QueryMode bool + QueryOnlyOne bool + QueryParamDelimiter string + QueryStrip bool + QueryTrim bool + QueryType string + QueryTypeComment string + Schema string + ShortNameTypeMap map[string]string + SingleFile bool + Suffix string + Tags string + TemplatePath string + Uint32Type string + UseIndexNames bool + UseReversedEnumConstNames bool + Verbose bool + var Args *ArgType + func NewDefaultArgs() *ArgType + func (a *ArgType) BuildIndexFuncName(ixTpl *Index) + func (a *ArgType) Description() string + func (a *ArgType) ExecuteTemplate(tt TemplateType, name string, sub string, obj interface{}) error + func (a *ArgType) ForeignKeyName(fkMap map[string]*ForeignKey, fk *ForeignKey) string + func (a *ArgType) NewTemplateFuncs() template.FuncMap + func (a *ArgType) ParsePrecision(dt string) (string, int, int) + func (a *ArgType) ParseQuery(mask string, interpol bool) (string, []*QueryParam) + func (a *ArgType) TemplateLoader(name string) ([]byte, error) + func (a *ArgType) TemplateSet() *TemplateSet + type Enum struct + Comment string + Enum *models.Enum + Name string + ReverseConstNames bool + Schema string + Values []*EnumValue + type EnumValue struct + Comment string + Name string + Val *models.EnumValue + type EscType uint + type Field struct + Col *models.Column + Comment string + GraphqlCreateExcluded bool + GraphqlFilterExcluded bool + GraphqlTypeExcluded bool + GraphqlUpdateExcluded bool + HasIndex bool + Len int + Name string + NilType string + Type string + type FkMode int + const FkModeField + const FkModeKey + const FkModeParent + const FkModeSmart + func (f *FkMode) UnmarshalText(text []byte) error + func (f FkMode) String() string + type ForeignKey struct + CallFuncName string + Comment string + Field *Field + ForeignKey *models.ForeignKey + FuncName string + IsUnique bool + Name string + RefField *Field + RefType *Type + RevertCallFuncName string + RevertFuncName string + Schema string + Type *Type + type ForeignKeyGroup struct + DependOnRepo []string + ManyToOneKeys []*ForeignKey + Name string + OneToManyKeys []*ForeignKey + TypeName string + type Index struct + Comment string + Fields []*Field + FuncName string + Index *models.Index + Schema string + Type *Type + type Loader interface + Escape func(EscType, string) string + LoadSchema func(*ArgType) error + Mask func() string + NthParam func(i int) string + ParseQuery func(*ArgType) error + Relkind func(RelType) string + SchemaName func(*ArgType) (string, error) + type Proc struct + Comment string + Name string + Params []*Field + Proc *models.Proc + ProcParams string + Return *Field + Schema string + type Query struct + Comment string + Interpolate bool + Name string + OnlyOne bool + Query []string + QueryComments []string + QueryParams []*QueryParam + Schema string + Type *Type + type QueryParam struct + Interpolate bool + Name string + Type string + type RelType uint + const Table + const View + func (rt RelType) String() string + type TBuf struct + Buf *bytes.Buffer + Name string + Subname string + TemplateType TemplateType + type TBufSlice []TBuf + func (t TBufSlice) Len() int + func (t TBufSlice) Less(i, j int) bool + func (t TBufSlice) Swap(i, j int) + type TemplateSet struct + func (ts *TemplateSet) Execute(w io.Writer, name string, obj interface{}) error + type TemplateType uint + const ApprovalMigrationTemplate + const AuditLogsMigrationTemplate + const EnumTemplate + const ForeignKeyTemplate + const GqlgenModelTemplate + const IndexInTypeTemplate + const IndexTemplate + const PaginationSchemaTemplate + const PaginationTemplate + const ProcTemplate + const QueryTemplate + const QueryTypeTemplate + const RepositoryCommonTemplate + const RepositoryErrorCommonTemplate + const RepositoryErrorTemplate + const RepositoryTemplate + const ScalarTemplate + const SchemaGraphQLEnumTemplate + const SchemaGraphQLScalarTemplate + const SchemaGraphQLTemplate + const TypeTemplate + const WireTemplate + const XOTemplate + func (tt TemplateType) String() string + type Type struct + Comment string + Fields []*Field + ForeignKeyGroup *ForeignKeyGroup + GraphQLIncludeFields map[string]string + HasActiveField bool + Indexes []*Index + Name string + PrimaryKey *Field + PrimaryKeyFields []*Field + RelType RelType + RepoName string + Schema string + Table *models.Table + func (t *Type) DoesTableGenApprovalTable() bool + func (t *Type) DoesTableGenAuditLogsTable() bool + func (t *Type) DoesTableGenAuditLogsTableV2() bool + func (t *Type) DraftFields() []approvalTableDraftField + func (t *Type) IsApprovalTableOnDuplicateUpdate() bool + func (t *Type) IsIncludeInactiveOnMove() bool + type TypeLoader struct + ColumnList func(models.XODB, string, string) ([]*models.Column, error) + EnumList func(models.XODB, string) ([]*models.Enum, error) + EnumValueList func(models.XODB, string, string, string) ([]*models.EnumValue, error) + Esc map[EscType]func(string) string + ForeignKeyList func(models.XODB, string, string) ([]*models.ForeignKey, error) + IndexColumnList func(models.XODB, string, string, string) ([]*models.IndexColumn, error) + IndexList func(models.XODB, string, string) ([]*models.Index, error) + MaskFunc func() string + ParamN func(int) string + ParseType func(*ArgType, string, string, bool) (int, string, string) + ProcList func(models.XODB, string) ([]*models.Proc, error) + ProcParamList func(models.XODB, string, string) ([]*models.ProcParam, error) + ProcessRelkind func(RelType) string + QueryColumnList func(*ArgType, []string) ([]*models.Column, error) + QueryStrip func([]string, []string) + Schema func(*ArgType) (string, error) + TableList func(models.XODB, string, string) ([]*models.Table, error) + func (tl TypeLoader) Escape(typ EscType, s string) string + func (tl TypeLoader) LoadColumns(args *ArgType, typeTpl *Type) error + func (tl TypeLoader) LoadEnumValues(args *ArgType, enumTpl *Enum) error + func (tl TypeLoader) LoadEnums(args *ArgType) (map[string]*Enum, error) + func (tl TypeLoader) LoadForeignKeys(args *ArgType, tableMap map[string]*Type, indexes map[*Type]map[string]*Index) (map[string]*ForeignKeyGroup, error) + func (tl TypeLoader) LoadGraphqlSchema(args *ArgType, tableMap map[string]*Type, ...) error + func (tl TypeLoader) LoadIndexColumns(args *ArgType, ixTpl *Index) error + func (tl TypeLoader) LoadIndexes(args *ArgType, tableMap map[string]*Type) (map[*Type]map[string]*Index, error) + func (tl TypeLoader) LoadProcParams(args *ArgType, procTpl *Proc) error + func (tl TypeLoader) LoadProcs(args *ArgType) (map[string]*Proc, error) + func (tl TypeLoader) LoadRelkind(args *ArgType, relType RelType) (map[string]*Type, error) + func (tl TypeLoader) LoadRepositories(args *ArgType, tableMap map[string]*Type, indexes map[*Type]map[string]*Index) error + func (tl TypeLoader) LoadSchema(args *ArgType) error + func (tl TypeLoader) LoadTableForeignKeys(args *ArgType, tableMap map[string]*Type, typeTpl *Type, ...) error + func (tl TypeLoader) LoadTableIndexes(args *ArgType, typeTpl *Type, ixMap map[string]*Index) error + func (tl TypeLoader) Mask() string + func (tl TypeLoader) NthParam(i int) string + func (tl TypeLoader) ParseQuery(args *ArgType) error + func (tl TypeLoader) Relkind(rt RelType) string + func (tl TypeLoader) SchemaName(args *ArgType) (string, error)