gormschema

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

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

Loader is a Loader for gorm schema.

func New

func New(dialect string, opts ...Option) *Loader

New returns a new Loader.

func (*Loader) Load

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

Load loads the models and returns the DDL statements representing the schema.

type Option added in v0.1.1

type Option func(*Loader)

Option configures the Loader.

func WithConfig added in v0.1.1

func WithConfig(cfg *gorm.Config) Option

WithConfig sets the gorm config.

func WithJoinTable added in v0.3.4

func WithJoinTable(model any, field string, jointable any) Option

WithJoinTable sets up a join table for the given model and field.

Jump to

Keyboard shortcuts

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