bunschema

package
v0.0.0-...-0c7738c Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

type Dialect string

Dialect is the type for supported dialects.

const (
	DialectMSSQL    Dialect = "mssql"
	DialectMySQL    Dialect = "mysql"
	DialectOracle   Dialect = "oracle"
	DialectPostgres Dialect = "postgres"
	DialectSQLite   Dialect = "sqlite"
)

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader is the struct that holds the loader configuration.

func New

func New(d Dialect, opts ...Option) *Loader

New creates a new Loader.

func (*Loader) Load

func (l *Loader) Load(models ...any) (string, error)

Load loads the models and returns DDL statements.

type Option

type Option func(*Loader)

Option is a function that configures the Loader.

func WithBuildTags

func WithBuildTags(tags string) Option

WithBuildTags sets the build tags to use when loading packages.

func WithJoinTable deprecated

func WithJoinTable(models ...any) Option

WithJoinTable registers the given models as join tables.

Deprecated: Join tables are now auto-detected based on struct tags. Models with rel:belongs-to (but no m2m) are automatically registered first. This option is kept for backward compatibility but is no longer required.

func WithStmtDelimiter

func WithStmtDelimiter(delimiter string) Option

WithStmtDelimiter sets the delimiter for the output. The default delimiter is `;`. This is helpful for SQL Server, which uses the GO keyword as a delimiter.

Jump to

Keyboard shortcuts

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