generator

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {
	// Generate generates files from the schema
	Generate(schema *definition.Schema, opts Options) error

	// Name returns the generator name
	Name() string

	// Description returns a description of what this generator produces
	Description() string
}

Generator is the interface that all schema generators must implement

type MigrationFile

type MigrationFile struct {
	Name    string
	Path    string
	Content string
}

MigrationFile represents a generated migration file

type Options

type Options struct {
	// OutputDir is the directory where generated files will be written
	OutputDir string

	// Dialect specifies the database dialect (postgres, mysql, sqlite, etc.)
	Dialect string

	// PackageName is the Go package name for generated code
	PackageName string

	// Overwrite determines if existing files should be overwritten
	Overwrite bool

	// Verbose enables verbose output
	Verbose bool

	// Custom contains generator-specific options
	Custom map[string]interface{}
}

Options contains common options for all generators

type Result

type Result struct {
	Files   []MigrationFile
	Message string
	Errors  []error
}

Result represents the result of a generation operation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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