Versions in this module Expand all Collapse all v0 v0.0.2 Aug 29, 2026 v0.0.1 Aug 28, 2026 Changes in this version + func DefaultOutputName(packageName string) string + func DiscoverPackages(pattern string) ([]string, error) + func Generate(spec GenerateSpec) ([]byte, error) + func GenerateWithRenderer(spec GenerateSpec, renderer TemplateRenderer) ([]byte, error) + func ParseFieldTag(raw string) (fieldTag, error) + func Render(model *PackageModel) ([]byte, error) + func ReverseEngineerWithRenderer(ctx context.Context, introspector SchemaIntrospector, spec ReverseEngineerSpec, ...) ([]byte, error) + func ValidateSchemaDrift(ctx context.Context, introspector SchemaIntrospector, registry *orm.Registry, ...) error + type ColumnModel struct + AutoIncrement bool + ColumnName string + Condition string + CreatedAt bool + DBType string + DefaultValue string + FieldName string + FieldType string + Fill orm.FieldFill + IDType orm.IDType + InsertStrategy orm.FieldStrategy + KeyColumn string + Nullable *bool + NumericScale *int + OrderBy bool + OrderDesc bool + OrderPriority int + PrimaryKey bool + SelectDisabled bool + Size *int + SoftDelete bool + Transient bool + TypeHandler string + UpdateExpression string + UpdateStrategy orm.FieldStrategy + UpdatedAt bool + Version bool + WhereStrategy orm.FieldStrategy + type ConfiguredGenerateSpec struct + Output string + Spec GenerateSpec + type EntityModel struct + Columns []ColumnModel + DeclareStruct bool + KeySequence string + Table string + TypeName string + type GenerateConfig struct + BuildTags []string + DatabaseID string + Dir string + Naming NamingConfig + Output string + PackageName string + Packages []GeneratePackageSpec + TypeHandlers []string + func LoadGenerateConfig(path string) (GenerateConfig, error) + func (c GenerateConfig) Resolve(baseDir string) ([]ConfiguredGenerateSpec, error) + type GeneratePackageSpec struct + BuildTags []string + DatabaseID string + Dir string + Naming NamingConfig + Output string + PackageName string + TypeHandlers []string + type GenerateSpec struct + BuildTags []string + DatabaseID string + Dir string + Naming NamingConfig + PackageName string + TypeHandlers []string + type GeneratedPackage struct + Dir string + PackageName string + Source []byte + type ImportModel struct + Name string + Path string + type MapperModel struct + Cache orm.CacheMeta + ImplTypeName string + Methods []MethodModel + Namespace string + ResultMaps []orm.ResultMapMeta + Statements []StatementModel + TypeName string + XML string + type MariaDBSQLSchemaDialect struct + type MethodModel struct + Command orm.StatementCommand + Name string + Params []ParamModel + ResultType string + Statement StatementModel + type MySQLSQLSchemaDialect struct + func (MySQLSQLSchemaDialect) ColumnsQuery(request SchemaIntrospectionRequest, table SchemaTable) (SQLSchemaQuery, error) + func (MySQLSQLSchemaDialect) TablesQuery(request SchemaIntrospectionRequest) (SQLSchemaQuery, error) + type NamingConfig struct + Column NamingStrategy + Table NamingStrategy + TablePrefix string + type NamingStrategy string + const NamingStrategyExplicit + const NamingStrategySame + const NamingStrategySnakeCase + type OracleSQLSchemaDialect struct + func (OracleSQLSchemaDialect) ColumnsQuery(request SchemaIntrospectionRequest, table SchemaTable) (SQLSchemaQuery, error) + func (OracleSQLSchemaDialect) TablesQuery(request SchemaIntrospectionRequest) (SQLSchemaQuery, error) + type PackageModel struct + Dir string + Entities []EntityModel + Imports []ImportModel + Mappers []MapperModel + PackageName string + func BuildPackageModelFromSchema(spec ReverseEngineerSpec, schema SchemaModel) (*PackageModel, error) + func ReverseEngineer(ctx context.Context, introspector SchemaIntrospector, spec ReverseEngineerSpec) (*PackageModel, error) + func ScanPackage(spec GenerateSpec) (*PackageModel, error) + type ParamModel struct + Name string + Type string + type PostgresSQLSchemaDialect struct + func (PostgresSQLSchemaDialect) ColumnsQuery(request SchemaIntrospectionRequest, table SchemaTable) (SQLSchemaQuery, error) + func (PostgresSQLSchemaDialect) TablesQuery(request SchemaIntrospectionRequest) (SQLSchemaQuery, error) + type ReverseEngineerSpec struct + ColumnFilter SchemaColumnFilter + ColumnOverrides map[string]SchemaColumnOverride + DatabaseID string + IgnoreColumns []string + NamingStrategy SchemaNamingStrategy + OmitEntityStruct bool + PackageName string + Schema string + TablePrefix string + Tables []string + TypeMapper SchemaTypeMapper + type SQLQueryer interface + QueryContext func(ctx context.Context, query string, args ...any) (*sql.Rows, error) + type SQLSchemaCompatibilityConfig struct + DBType orm.DbType + DriftOptions []SchemaDriftOption + PackageName string + Queryer SchemaQueryer + Registry *orm.Registry + ReverseSpec ReverseEngineerSpec + SQLQueryer SQLQueryer + Schema string + Tables []string + type SQLSchemaCompatibilityReport struct + Drift SchemaDriftReport + Model *PackageModel + Schema SchemaModel + Source []byte + func ValidateSQLSchemaCompatibility(ctx context.Context, config SQLSchemaCompatibilityConfig) (SQLSchemaCompatibilityReport, error) + type SQLSchemaDialect interface + ColumnsQuery func(request SchemaIntrospectionRequest, table SchemaTable) (SQLSchemaQuery, error) + TablesQuery func(request SchemaIntrospectionRequest) (SQLSchemaQuery, error) + func NewSQLSchemaDialect(dbType orm.DbType) (SQLSchemaDialect, error) + type SQLSchemaIntrospector struct + func NewSQLSchemaIntrospector(queryer SQLQueryer, dialect SQLSchemaDialect) (*SQLSchemaIntrospector, error) + func NewSQLSchemaIntrospectorWithQueryer(queryer SchemaQueryer, dialect SQLSchemaDialect) (*SQLSchemaIntrospector, error) + func (i *SQLSchemaIntrospector) IntrospectSchema(ctx context.Context, request SchemaIntrospectionRequest) (SchemaModel, error) + type SQLSchemaQuery struct + Args []any + SQL string + type SQLServerSQLSchemaDialect struct + func (SQLServerSQLSchemaDialect) ColumnsQuery(request SchemaIntrospectionRequest, table SchemaTable) (SQLSchemaQuery, error) + func (SQLServerSQLSchemaDialect) TablesQuery(request SchemaIntrospectionRequest) (SQLSchemaQuery, error) + type SQLiteSQLSchemaDialect struct + func (SQLiteSQLSchemaDialect) ColumnsQuery(_ SchemaIntrospectionRequest, table SchemaTable) (SQLSchemaQuery, error) + func (SQLiteSQLSchemaDialect) TablesQuery(SchemaIntrospectionRequest) (SQLSchemaQuery, error) + type SchemaColumn struct + AutoIncrement bool + DBType string + DefaultValue string + FieldName string + GoType string + Name string + Nullable *bool + NumericScale *int + PrimaryKey bool + Size *int + TypeHandler string + type SchemaColumnFilter interface + IncludeColumn func(table SchemaTable, column SchemaColumn) bool + type SchemaColumnFilterFunc func(table SchemaTable, column SchemaColumn) bool + func (f SchemaColumnFilterFunc) IncludeColumn(table SchemaTable, column SchemaColumn) bool + type SchemaColumnOverride struct + Condition string + CreatedAt *bool + FieldName string + Fill orm.FieldFill + GoType string + IDType orm.IDType + InsertStrategy orm.FieldStrategy + SelectDisabled *bool + SoftDelete *bool + TypeHandler string + UpdateStrategy orm.FieldStrategy + UpdatedAt *bool + Version *bool + WhereStrategy orm.FieldStrategy + type SchemaCompatibilityError struct + Message string + func (e *SchemaCompatibilityError) Error() string + type SchemaDriftIssue struct + Actual string + Column string + Entity string + Expected string + Field string + Kind SchemaDriftKind + Table string + type SchemaDriftKind string + const SchemaDriftAutoIncrementMismatch + const SchemaDriftExtraColumn + const SchemaDriftMissingColumn + const SchemaDriftMissingTable + const SchemaDriftNullableMismatch + const SchemaDriftNumericScaleMismatch + const SchemaDriftPrimaryKeyMismatch + const SchemaDriftSizeMismatch + const SchemaDriftTypeMismatch + type SchemaDriftOption func(*schemaDriftOptions) + func WithSchemaDriftExtraColumns(enabled bool) SchemaDriftOption + type SchemaDriftReport struct + Issues []SchemaDriftIssue + func CompareSchemaDrift(registry *orm.Registry, schema SchemaModel, options ...SchemaDriftOption) (SchemaDriftReport, error) + func DetectSchemaDrift(ctx context.Context, introspector SchemaIntrospector, registry *orm.Registry, ...) (SchemaDriftReport, error) + func (r SchemaDriftReport) Error() string + func (r SchemaDriftReport) HasDrift() bool + type SchemaIntrospectionRequest struct + DatabaseID string + Schema string + Tables []string + type SchemaIntrospector interface + IntrospectSchema func(ctx context.Context, request SchemaIntrospectionRequest) (SchemaModel, error) + type SchemaModel struct + Tables []SchemaTable + type SchemaNamingStrategy interface + EntityTypeName func(table SchemaTable, tablePrefix string) (string, error) + FieldName func(table SchemaTable, column SchemaColumn) (string, error) + func DefaultSchemaNamingStrategy() SchemaNamingStrategy + type SchemaNamingStrategyFuncs struct + EntityTypeNameFunc func(SchemaTable, string) (string, error) + FieldNameFunc func(SchemaTable, SchemaColumn) (string, error) + func (s SchemaNamingStrategyFuncs) EntityTypeName(table SchemaTable, tablePrefix string) (string, error) + func (s SchemaNamingStrategyFuncs) FieldName(table SchemaTable, column SchemaColumn) (string, error) + type SchemaQueryer interface + QuerySchema func(ctx context.Context, query string, args ...any) (SchemaRows, error) + type SchemaQueryerFunc func(ctx context.Context, query string, args ...any) (SchemaRows, error) + func (f SchemaQueryerFunc) QuerySchema(ctx context.Context, query string, args ...any) (SchemaRows, error) + type SchemaRows interface + Close func() error + Err func() error + Next func() bool + Scan func(dest ...any) error + type SchemaTable struct + Columns []SchemaColumn + Name string + TypeName string + type SchemaTypeMapper interface + GoType func(column SchemaColumn) (string, error) + func DefaultSchemaTypeMapper() SchemaTypeMapper + type SchemaTypeMapperFunc func(column SchemaColumn) (string, error) + func (f SchemaTypeMapperFunc) GoType(column SchemaColumn) (string, error) + type StatementModel struct + AffectData bool + Command orm.StatementCommand + DatabaseID string + DynamicSQL []orm.DynamicSQLNode + FlushCache orm.StatementCachePolicy + FullName string + ID string + InterceptorIgnores []string + KeyProperty string + Namespace string + Options orm.StatementOptions + ParameterModes []orm.ParameterMeta + ParameterType string + Parameters []string + Provider string + ResultMap string + ResultSets []orm.ResultSetMeta + ResultType string + SQL string + SelectKey orm.SelectKeyMeta + Source orm.StatementSource + StatementType orm.StatementType + UseCache orm.StatementCachePolicy + UseGeneratedKeys bool + type TemplateRenderer interface + RenderPackage func(model *PackageModel) ([]byte, error) + func DefaultTemplateRenderer() TemplateRenderer + type TemplateRendererFunc func(model *PackageModel) ([]byte, error) + func (f TemplateRendererFunc) RenderPackage(model *PackageModel) ([]byte, error)