Documentation ¶
Index ¶
- Variables
- func BuildCustomType(modelPkgName, path string, ...)
- func BuildDbMainFile(modelPkgName, path string, queries []preformShare.IQueryBuilder, ...)
- func BuildEnum(modelPkgName, path string, enumsBySchema map[string]map[string][]string)
- func BuildModel(conn *sql.DB, modelPkgName, outputFiles string, schemasEmptyIsAll ...string)
- func BuildSchema(modelPkgName, path, defaultDbOrSchema, schemaCodeName string, ...)
- func FkComposite(lk, fk preformShare.IColDef) foreignKeyCnfSetter
- func FkCond(cond preformShare.ICondForBuilder, reverseCond ...preformShare.ICondForBuilder) foreignKeyCnfSetter
- func FkMiddleTable(table preformShare.IFactoryBuilder, localKeys []preformShare.IColDef, ...) foreignKeyCnfSetter
- func FkName(name string) foreignKeyCnfSetter
- func FkRelationName(name string) foreignKeyCnfSetter
- func FkReverse(r reverseType) foreignKeyCnfSetter
- func FkReverseName(name string) foreignKeyCnfSetter
- func FkToMany() foreignKeyCnfSetter
- func InitColBySchema(col *preformShare.Column, builder iFactoryBuilder) iColDef
- func InitFactoryBuilder[D iFactoryBuilder](schemaName string, setter func(D)) D
- func PrepareSchema(modelPkgName, path, defaultDbOrSchema, schemaCodeName string, ...)
- type ColumnDef
- func (a ColumnDef) Aggregate(fn preformShare.Aggregator, aggregatedType reflect.Type, params ...any) *aggregatedCol[T]
- func (c ColumnDef) Alias() string
- func (a ColumnDef) Avg() *aggregatedCol[T]
- func (c ColumnDef) CodeName() string
- func (c ColumnDef[T]) ColDef() preformShare.IColDef
- func (a ColumnDef) Count() *aggregatedCol[T]
- func (a ColumnDef) CountDistinct() *aggregatedCol[T]
- func (c ColumnDef) Factory() preformShare.IFactoryBuilder
- func (c ColumnDef[T]) GenerateCode(schemaName string, fromQuery bool) (importPath []string, defColCode []string, modelColCode []string, ...)
- func (c ColumnDef[T]) GetType() reflect.Type
- func (a ColumnDef) GroupConcat(splitter string) *aggregatedCol[T]
- func (c *ColumnDef[T]) InitCol(ref *reflect.StructField, builder iFactoryBuilder)
- func (a ColumnDef) Max() *aggregatedCol[T]
- func (a ColumnDef) Mean() *aggregatedCol[T]
- func (a ColumnDef) Median() *aggregatedCol[T]
- func (a ColumnDef) Min() *aggregatedCol[T]
- func (a ColumnDef) Mode() *aggregatedCol[T]
- func (c ColumnDef) OColName() string
- func (c *ColumnDef[T]) OverwriteType(col preformShare.IColDef) *ColumnDef[T]
- func (c *ColumnDef[T]) PK() *PrimaryKeyDef[T]
- func (c ColumnDef) RelatedFk(def preformShare.IColDef) *columnDef[T]
- func (c ColumnDef) RelatedFks() []preformShare.IColDef
- func (c *ColumnDef[T]) SetAlias(alias string) *ColumnDef[T]
- func (c ColumnDef[T]) SetAliasI(alias string) preformShare.IColDef
- func (c *ColumnDef[T]) SetName(name string) *ColumnDef[T]
- func (c ColumnDef) SrcName() string
- func (a ColumnDef) StdDev() *aggregatedCol[T]
- func (a ColumnDef) Sum() *aggregatedCol[T]
- type ConditionForBuilder
- func (c ConditionForBuilder[T]) And(cond ...preformShare.ICondForBuilder) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) Any(value any) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) Between(value1, value2 any) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) Eq(value any) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) Gt(value any) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) GtOrEq(value any) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) HasAny(value ...any) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) IAnd(cond ...preformShare.ICondForBuilder) preformShare.ICondForBuilder
- func (c ConditionForBuilder[T]) Lt(value any) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) LtOrEq(value any) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) NotEq(value any) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) Or(cond ...preformShare.ICondForBuilder) ConditionForBuilder[T]
- func (c ConditionForBuilder[T]) ToCode() string
- func (c ConditionForBuilder[T]) ToCondCode() string
- func (c ConditionForBuilder[T]) UseAlias(cols ...preformShare.IColDef) preformShare.ICondForBuilder
- type FactoryBuilder
- func (f *FactoryBuilder[D]) AddAssociated(builder preformShare.IFactoryBuilder)
- func (f *FactoryBuilder[D]) AddCode(def, model, setting, extraFuncs []string, setRelationCodes [][]string)
- func (f *FactoryBuilder[D]) AddCustomField(name string, valueType reflect.Type)
- func (f *FactoryBuilder[D]) AddInheritor(tableName string) preformShare.IFactoryBuilder
- func (f *FactoryBuilder[D]) AddInheritorByCondition(codeName string, cond preformShare.ICondForBuilder) preformShare.IFactoryBuilder
- func (f FactoryBuilder[D]) Alias() string
- func (f FactoryBuilder[D]) AllFieldNames() map[string]struct{}
- func (f *FactoryBuilder[D]) AssociatedModelTimes(model preformShare.IFactoryBuilder) int
- func (f *FactoryBuilder[D]) Clone() preformShare.IFactoryBuilder
- func (f FactoryBuilder[D]) CodeName() string
- func (f FactoryBuilder[D]) ColSet() map[string]preformShare.IColDef
- func (f FactoryBuilder[D]) Cols() []preformShare.IColDef
- func (f FactoryBuilder[D]) FactoryType() reflect.Type
- func (f *FactoryBuilder[D]) FullCodeName() string
- func (f *FactoryBuilder[D]) IsView()
- func (f *FactoryBuilder[D]) PK() []preformShare.IColDef
- func (f FactoryBuilder[D]) SchemaName() string
- func (f *FactoryBuilder[D]) SetAlias(alias string) preformShare.IFactoryBuilder
- func (f *FactoryBuilder[D]) SetTableName(name string) *FactoryBuilder[D]
- func (f FactoryBuilder[D]) TableName() string
- type ForeignKeyDef
- func (a ForeignKeyDef) Aggregate(fn preformShare.Aggregator, aggregatedType reflect.Type, params ...any) *aggregatedCol[T]
- func (c ForeignKeyDef) Alias() string
- func (c ForeignKeyDef[T]) AutoAssociatedCond(factories []preformShare.IFactoryBuilder) preformShare.ICondForBuilder
- func (a ForeignKeyDef) Avg() *aggregatedCol[T]
- func (c ForeignKeyDef) CodeName() string
- func (c ForeignKeyDef[T]) ColDef() preformShare.IColDef
- func (a ForeignKeyDef) Count() *aggregatedCol[T]
- func (a ForeignKeyDef) CountDistinct() *aggregatedCol[T]
- func (c ForeignKeyDef) Factory() preformShare.IFactoryBuilder
- func (c ForeignKeyDef[T]) GenerateCode(schemaName string, fromQuery bool) (importPath []string, defColCode []string, modelColCode []string, ...)
- func (c ForeignKeyDef[T]) GetSetRelationCodes() (codes [][]string)
- func (a ForeignKeyDef) GroupConcat(splitter string) *aggregatedCol[T]
- func (c *ForeignKeyDef[T]) InitCol(ref *reflect.StructField, builder iFactoryBuilder)
- func (a ForeignKeyDef) Max() *aggregatedCol[T]
- func (a ForeignKeyDef) Mean() *aggregatedCol[T]
- func (a ForeignKeyDef) Median() *aggregatedCol[T]
- func (a ForeignKeyDef) Min() *aggregatedCol[T]
- func (a ForeignKeyDef) Mode() *aggregatedCol[T]
- func (c ForeignKeyDef) OColName() string
- func (c *ForeignKeyDef[T]) PK() *ForeignKeyDef[T]
- func (c ForeignKeyDef) RelatedFk(def preformShare.IColDef) *columnDef[T]
- func (c ForeignKeyDef) RelatedFks() []preformShare.IColDef
- func (c *ForeignKeyDef[T]) SetAlias(alias string) *ForeignKeyDef[T]
- func (c ForeignKeyDef[T]) SetAliasI(alias string) preformShare.IColDef
- func (c *ForeignKeyDef[T]) SetAssociatedKey(col preformShare.IColDef, setters ...foreignKeyCnfSetter) *ForeignKeyDef[T]
- func (c *ForeignKeyDef[T]) SetName(name string) *ForeignKeyDef[T]
- func (c ForeignKeyDef) SrcName() string
- func (a ForeignKeyDef) StdDev() *aggregatedCol[T]
- func (a ForeignKeyDef) Sum() *aggregatedCol[T]
- type PrimaryKeyDef
- func (a PrimaryKeyDef) Aggregate(fn preformShare.Aggregator, aggregatedType reflect.Type, params ...any) *aggregatedCol[T]
- func (c PrimaryKeyDef) Alias() string
- func (c *PrimaryKeyDef[T]) AutoIncrement() *PrimaryKeyDef[T]
- func (a PrimaryKeyDef) Avg() *aggregatedCol[T]
- func (c PrimaryKeyDef) CodeName() string
- func (a PrimaryKeyDef) Count() *aggregatedCol[T]
- func (a PrimaryKeyDef) CountDistinct() *aggregatedCol[T]
- func (c PrimaryKeyDef) Factory() preformShare.IFactoryBuilder
- func (c PrimaryKeyDef[T]) GenerateCode(schemaName string, fromQuery bool) (importPath []string, defColCode []string, modelColCode []string, ...)
- func (a PrimaryKeyDef) GroupConcat(splitter string) *aggregatedCol[T]
- func (c *PrimaryKeyDef[T]) InitCol(ref *reflect.StructField, builder iFactoryBuilder)
- func (a PrimaryKeyDef) Max() *aggregatedCol[T]
- func (a PrimaryKeyDef) Mean() *aggregatedCol[T]
- func (a PrimaryKeyDef) Median() *aggregatedCol[T]
- func (a PrimaryKeyDef) Min() *aggregatedCol[T]
- func (a PrimaryKeyDef) Mode() *aggregatedCol[T]
- func (c PrimaryKeyDef) OColName() string
- func (c PrimaryKeyDef) RelatedFk(def preformShare.IColDef) *columnDef[T]
- func (c PrimaryKeyDef) RelatedFks() []preformShare.IColDef
- func (c PrimaryKeyDef) SrcName() string
- func (a PrimaryKeyDef) StdDev() *aggregatedCol[T]
- func (a PrimaryKeyDef) Sum() *aggregatedCol[T]
- type QueryBuilder
- func (builder *QueryBuilder) Cols(cols ...preformShare.IColDef) *QueryBuilder
- func (builder *QueryBuilder) From(f preformShare.IFactoryBuilder) *QueryBuilderSetAlias
- func (builder *QueryBuilder) GenerateCode(schemaName string) (name, schemaField, factoryName, defCode, modelCode string, ...)
- func (builder *QueryBuilder) GroupBy(stmt ...any) *QueryBuilder
- func (builder *QueryBuilder) Having(condition preformShare.ICondForBuilder) *QueryBuilder
- func (builder *QueryBuilder) InnerJoin(f preformShare.IFactoryBuilder, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
- func (builder *QueryBuilder) InnerJoinByForeignKey(fk foreignKeyForJoin, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
- func (builder *QueryBuilder) LeftJoin(f preformShare.IFactoryBuilder, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
- func (builder *QueryBuilder) LeftJoinByForeignKey(fk foreignKeyForJoin, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
- func (builder *QueryBuilder) RightJoin(f preformShare.IFactoryBuilder, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
- func (builder *QueryBuilder) RightJoinByForeignKey(fk foreignKeyForJoin, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
- func (builder *QueryBuilder) Where(condition preformShare.ICondForBuilder) *QueryBuilder
- type QueryBuilderSetAlias
- type QueryBuilderSrc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ForeignKeyCnfSetters = foreignKeyCnf{} ReverseType = allReverseType{ToMany: 0, ToOne: 1, NoReverse: 2} )
Functions ¶
func BuildCustomType ¶
func BuildCustomType(modelPkgName, path string, customTypesBySchema map[string]map[string]*preformShare.CustomType)
func BuildDbMainFile ¶
func BuildDbMainFile(modelPkgName, path string, queries []preformShare.IQueryBuilder, schemas ...string)
func BuildModel ¶
func BuildSchema ¶
func BuildSchema(modelPkgName, path, defaultDbOrSchema, schemaCodeName string, factories []preformShare.IFactoryBuilder, enums map[string][]string, customTypes map[string]*preformShare.CustomType)
func FkComposite ¶
func FkComposite(lk, fk preformShare.IColDef) foreignKeyCnfSetter
func FkCond ¶
func FkCond(cond preformShare.ICondForBuilder, reverseCond ...preformShare.ICondForBuilder) foreignKeyCnfSetter
func FkMiddleTable ¶
func FkMiddleTable(table preformShare.IFactoryBuilder, localKeys []preformShare.IColDef, mtLocalKey []preformShare.IColDef, foreignKeys []preformShare.IColDef, mtForeignKey []preformShare.IColDef) foreignKeyCnfSetter
func FkRelationName ¶
func FkRelationName(name string) foreignKeyCnfSetter
func FkReverseName ¶
func FkReverseName(name string) foreignKeyCnfSetter
func InitColBySchema ¶
func InitColBySchema(col *preformShare.Column, builder iFactoryBuilder) iColDef
func InitFactoryBuilder ¶
func InitFactoryBuilder[D iFactoryBuilder](schemaName string, setter func(D)) D
func PrepareSchema ¶
func PrepareSchema(modelPkgName, path, defaultDbOrSchema, schemaCodeName string, factories []preformShare.IFactoryBuilder)
Types ¶
type ColumnDef ¶
type ColumnDef[T any] struct { // contains filtered or unexported fields }
func (ColumnDef) Aggregate ¶
func (a ColumnDef) Aggregate(fn preformShare.Aggregator, aggregatedType reflect.Type, params ...any) *aggregatedCol[T]
func (ColumnDef[T]) ColDef ¶
func (c ColumnDef[T]) ColDef() preformShare.IColDef
func (ColumnDef) CountDistinct ¶
func (a ColumnDef) CountDistinct() *aggregatedCol[T]
func (ColumnDef) Factory ¶
func (c ColumnDef) Factory() preformShare.IFactoryBuilder
func (ColumnDef[T]) GenerateCode ¶
func (ColumnDef) GroupConcat ¶
func (a ColumnDef) GroupConcat(splitter string) *aggregatedCol[T]
func (*ColumnDef[T]) InitCol ¶
func (c *ColumnDef[T]) InitCol(ref *reflect.StructField, builder iFactoryBuilder)
func (*ColumnDef[T]) OverwriteType ¶
func (c *ColumnDef[T]) OverwriteType(col preformShare.IColDef) *ColumnDef[T]
OverwriteType
func (*ColumnDef[T]) PK ¶
func (c *ColumnDef[T]) PK() *PrimaryKeyDef[T]
func (ColumnDef) RelatedFk ¶
func (c ColumnDef) RelatedFk(def preformShare.IColDef) *columnDef[T]
func (ColumnDef) RelatedFks ¶
func (c ColumnDef) RelatedFks() []preformShare.IColDef
type ConditionForBuilder ¶
type ConditionForBuilder[T any] struct { // contains filtered or unexported fields }
func NewConditionForBuilder ¶
func NewConditionForBuilder[T any](column preformShare.IColDef) ConditionForBuilder[T]
func (ConditionForBuilder[T]) And ¶
func (c ConditionForBuilder[T]) And(cond ...preformShare.ICondForBuilder) ConditionForBuilder[T]
func (ConditionForBuilder[T]) Any ¶
func (c ConditionForBuilder[T]) Any(value any) ConditionForBuilder[T]
func (ConditionForBuilder[T]) Between ¶
func (c ConditionForBuilder[T]) Between(value1, value2 any) ConditionForBuilder[T]
Between
func (ConditionForBuilder[T]) Eq ¶
func (c ConditionForBuilder[T]) Eq(value any) ConditionForBuilder[T]
Eq
func (ConditionForBuilder[T]) Gt ¶
func (c ConditionForBuilder[T]) Gt(value any) ConditionForBuilder[T]
Gt
func (ConditionForBuilder[T]) GtOrEq ¶
func (c ConditionForBuilder[T]) GtOrEq(value any) ConditionForBuilder[T]
GtOrEq
func (ConditionForBuilder[T]) HasAny ¶
func (c ConditionForBuilder[T]) HasAny(value ...any) ConditionForBuilder[T]
HasAny
func (ConditionForBuilder[T]) IAnd ¶
func (c ConditionForBuilder[T]) IAnd(cond ...preformShare.ICondForBuilder) preformShare.ICondForBuilder
func (ConditionForBuilder[T]) Lt ¶
func (c ConditionForBuilder[T]) Lt(value any) ConditionForBuilder[T]
Lt
func (ConditionForBuilder[T]) LtOrEq ¶
func (c ConditionForBuilder[T]) LtOrEq(value any) ConditionForBuilder[T]
LtOrEq
func (ConditionForBuilder[T]) NotEq ¶
func (c ConditionForBuilder[T]) NotEq(value any) ConditionForBuilder[T]
Neq
func (ConditionForBuilder[T]) Or ¶
func (c ConditionForBuilder[T]) Or(cond ...preformShare.ICondForBuilder) ConditionForBuilder[T]
func (ConditionForBuilder[T]) ToCode ¶
func (c ConditionForBuilder[T]) ToCode() string
func (ConditionForBuilder[T]) ToCondCode ¶
func (c ConditionForBuilder[T]) ToCondCode() string
func (ConditionForBuilder[T]) UseAlias ¶
func (c ConditionForBuilder[T]) UseAlias(cols ...preformShare.IColDef) preformShare.ICondForBuilder
type FactoryBuilder ¶
type FactoryBuilder[D iFactoryBuilder] struct { Definition D // contains filtered or unexported fields }
func InitFactoryFromTable ¶
func InitFactoryFromTable(table *preformShare.Table, importPaths map[string]struct{}) *FactoryBuilder[iFactoryBuilder]
func (*FactoryBuilder[D]) AddAssociated ¶
func (f *FactoryBuilder[D]) AddAssociated(builder preformShare.IFactoryBuilder)
func (*FactoryBuilder[D]) AddCode ¶
func (f *FactoryBuilder[D]) AddCode(def, model, setting, extraFuncs []string, setRelationCodes [][]string)
func (*FactoryBuilder[D]) AddCustomField ¶
func (f *FactoryBuilder[D]) AddCustomField(name string, valueType reflect.Type)
func (*FactoryBuilder[D]) AddInheritor ¶
func (f *FactoryBuilder[D]) AddInheritor(tableName string) preformShare.IFactoryBuilder
func (*FactoryBuilder[D]) AddInheritorByCondition ¶
func (f *FactoryBuilder[D]) AddInheritorByCondition(codeName string, cond preformShare.ICondForBuilder) preformShare.IFactoryBuilder
func (FactoryBuilder[D]) Alias ¶
func (f FactoryBuilder[D]) Alias() string
func (FactoryBuilder[D]) AllFieldNames ¶
func (f FactoryBuilder[D]) AllFieldNames() map[string]struct{}
func (*FactoryBuilder[D]) AssociatedModelTimes ¶
func (f *FactoryBuilder[D]) AssociatedModelTimes(model preformShare.IFactoryBuilder) int
func (*FactoryBuilder[D]) Clone ¶
func (f *FactoryBuilder[D]) Clone() preformShare.IFactoryBuilder
func (FactoryBuilder[D]) CodeName ¶
func (f FactoryBuilder[D]) CodeName() string
func (FactoryBuilder[D]) ColSet ¶
func (f FactoryBuilder[D]) ColSet() map[string]preformShare.IColDef
func (FactoryBuilder[D]) Cols ¶
func (f FactoryBuilder[D]) Cols() []preformShare.IColDef
func (FactoryBuilder[D]) FactoryType ¶
func (f FactoryBuilder[D]) FactoryType() reflect.Type
func (*FactoryBuilder[D]) FullCodeName ¶
func (f *FactoryBuilder[D]) FullCodeName() string
func (*FactoryBuilder[D]) IsView ¶
func (f *FactoryBuilder[D]) IsView()
func (FactoryBuilder[D]) SchemaName ¶
func (f FactoryBuilder[D]) SchemaName() string
func (*FactoryBuilder[D]) SetAlias ¶
func (f *FactoryBuilder[D]) SetAlias(alias string) preformShare.IFactoryBuilder
func (*FactoryBuilder[D]) SetTableName ¶
func (f *FactoryBuilder[D]) SetTableName(name string) *FactoryBuilder[D]
func (FactoryBuilder[D]) TableName ¶
func (f FactoryBuilder[D]) TableName() string
type ForeignKeyDef ¶
func (ForeignKeyDef) Aggregate ¶
func (a ForeignKeyDef) Aggregate(fn preformShare.Aggregator, aggregatedType reflect.Type, params ...any) *aggregatedCol[T]
func (ForeignKeyDef[T]) AutoAssociatedCond ¶
func (c ForeignKeyDef[T]) AutoAssociatedCond(factories []preformShare.IFactoryBuilder) preformShare.ICondForBuilder
func (ForeignKeyDef[T]) ColDef ¶
func (c ForeignKeyDef[T]) ColDef() preformShare.IColDef
func (ForeignKeyDef) CountDistinct ¶
func (a ForeignKeyDef) CountDistinct() *aggregatedCol[T]
func (ForeignKeyDef) Factory ¶
func (c ForeignKeyDef) Factory() preformShare.IFactoryBuilder
func (ForeignKeyDef[T]) GenerateCode ¶
func (ForeignKeyDef[T]) GetSetRelationCodes ¶
func (c ForeignKeyDef[T]) GetSetRelationCodes() (codes [][]string)
func (ForeignKeyDef) GroupConcat ¶
func (a ForeignKeyDef) GroupConcat(splitter string) *aggregatedCol[T]
func (*ForeignKeyDef[T]) InitCol ¶
func (c *ForeignKeyDef[T]) InitCol(ref *reflect.StructField, builder iFactoryBuilder)
func (*ForeignKeyDef[T]) PK ¶
func (c *ForeignKeyDef[T]) PK() *ForeignKeyDef[T]
func (ForeignKeyDef) RelatedFk ¶
func (c ForeignKeyDef) RelatedFk(def preformShare.IColDef) *columnDef[T]
func (ForeignKeyDef) RelatedFks ¶
func (c ForeignKeyDef) RelatedFks() []preformShare.IColDef
func (*ForeignKeyDef[T]) SetAlias ¶
func (c *ForeignKeyDef[T]) SetAlias(alias string) *ForeignKeyDef[T]
func (ForeignKeyDef[T]) SetAliasI ¶
func (c ForeignKeyDef[T]) SetAliasI(alias string) preformShare.IColDef
func (*ForeignKeyDef[T]) SetAssociatedKey ¶
func (c *ForeignKeyDef[T]) SetAssociatedKey(col preformShare.IColDef, setters ...foreignKeyCnfSetter) *ForeignKeyDef[T]
func (*ForeignKeyDef[T]) SetName ¶
func (c *ForeignKeyDef[T]) SetName(name string) *ForeignKeyDef[T]
type PrimaryKeyDef ¶
type PrimaryKeyDef[T any] struct { *ForeignKeyDef[T] }
func (PrimaryKeyDef) Aggregate ¶
func (a PrimaryKeyDef) Aggregate(fn preformShare.Aggregator, aggregatedType reflect.Type, params ...any) *aggregatedCol[T]
func (*PrimaryKeyDef[T]) AutoIncrement ¶
func (c *PrimaryKeyDef[T]) AutoIncrement() *PrimaryKeyDef[T]
func (PrimaryKeyDef) CountDistinct ¶
func (a PrimaryKeyDef) CountDistinct() *aggregatedCol[T]
func (PrimaryKeyDef) Factory ¶
func (c PrimaryKeyDef) Factory() preformShare.IFactoryBuilder
func (PrimaryKeyDef[T]) GenerateCode ¶
func (PrimaryKeyDef) GroupConcat ¶
func (a PrimaryKeyDef) GroupConcat(splitter string) *aggregatedCol[T]
func (*PrimaryKeyDef[T]) InitCol ¶
func (c *PrimaryKeyDef[T]) InitCol(ref *reflect.StructField, builder iFactoryBuilder)
func (PrimaryKeyDef) RelatedFk ¶
func (c PrimaryKeyDef) RelatedFk(def preformShare.IColDef) *columnDef[T]
func (PrimaryKeyDef) RelatedFks ¶
func (c PrimaryKeyDef) RelatedFks() []preformShare.IColDef
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
func BuildQuery ¶
func BuildQuery(name string, funcAcceptBuilderPlusModels any) *QueryBuilder
func (*QueryBuilder) Cols ¶
func (builder *QueryBuilder) Cols(cols ...preformShare.IColDef) *QueryBuilder
func (*QueryBuilder) From ¶
func (builder *QueryBuilder) From(f preformShare.IFactoryBuilder) *QueryBuilderSetAlias
func (*QueryBuilder) GenerateCode ¶
func (builder *QueryBuilder) GenerateCode(schemaName string) (name, schemaField, factoryName, defCode, modelCode string, importPaths []string)
func (*QueryBuilder) GroupBy ¶
func (builder *QueryBuilder) GroupBy(stmt ...any) *QueryBuilder
func (*QueryBuilder) Having ¶
func (builder *QueryBuilder) Having(condition preformShare.ICondForBuilder) *QueryBuilder
func (*QueryBuilder) InnerJoin ¶
func (builder *QueryBuilder) InnerJoin(f preformShare.IFactoryBuilder, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
func (*QueryBuilder) InnerJoinByForeignKey ¶
func (builder *QueryBuilder) InnerJoinByForeignKey(fk foreignKeyForJoin, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
func (*QueryBuilder) LeftJoin ¶
func (builder *QueryBuilder) LeftJoin(f preformShare.IFactoryBuilder, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
func (*QueryBuilder) LeftJoinByForeignKey ¶
func (builder *QueryBuilder) LeftJoinByForeignKey(fk foreignKeyForJoin, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
func (*QueryBuilder) RightJoin ¶
func (builder *QueryBuilder) RightJoin(f preformShare.IFactoryBuilder, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
func (*QueryBuilder) RightJoinByForeignKey ¶
func (builder *QueryBuilder) RightJoinByForeignKey(fk foreignKeyForJoin, cond ...preformShare.ICondForBuilder) *QueryBuilderSetAlias
func (*QueryBuilder) Where ¶
func (builder *QueryBuilder) Where(condition preformShare.ICondForBuilder) *QueryBuilder
type QueryBuilderSetAlias ¶
type QueryBuilderSetAlias struct { *QueryBuilder // contains filtered or unexported fields }
func (*QueryBuilderSetAlias) As ¶
func (builder *QueryBuilderSetAlias) As(alias string) *QueryBuilder
type QueryBuilderSrc ¶
type QueryBuilderSrc[T preformShare.IFactoryBuilder] struct { // contains filtered or unexported fields }
func NewQueryBuilderSrc ¶
func NewQueryBuilderSrc[T preformShare.IFactoryBuilder](model T) *QueryBuilderSrc[T]
func (*QueryBuilderSrc[T]) JoinCond ¶
func (v *QueryBuilderSrc[T]) JoinCond(cond preformShare.ICondForBuilder) *QueryBuilderSrc[T]
Click to show internal directories.
Click to hide internal directories.