generator

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(ctx context.Context, packageSources source.PackageSourceSlice) error

Types

type ColumnInfo

type ColumnInfo struct {
	FieldName   string
	FieldType   string
	ColumnName  string
	PK          bool
	HasOneTags  []string
	HasManyTags []string
}

type FileInfo

type FileInfo struct {
	SourceFile                 string
	PackageName                string
	PackageImportPath          string
	ORMCommonPackageImportPath string
	ORMOptPackageImportPath    string
	Dialect                    string
	SliceTypeSuffix            string
	Tables                     []*TableInfo
}

type TableInfo

type TableInfo struct {
	StructName      string
	TableName       string
	Columns         []*ColumnInfo
	PrimaryKeys     []*ColumnInfo
	NotPrimaryKeys  []*ColumnInfo
	HasOneTagsKeys  []string
	HasOneTags      map[string][]*ColumnInfo
	HasManyTagsKeys []string
	HasManyTags     map[string][]*ColumnInfo
}

func BuildTableInfo

func BuildTableInfo(ctx context.Context, structSource *source.StructSource) *TableInfo

Directories

Path Synopsis
templates

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL