schema

package
v2.0.0-...-10e4721 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Models []Model

Functions

func DoMigration

func DoMigration(db *gorm.DB) error

func GetMigrationScript

func GetMigrationScript(db *gorm.DB) []string

func UseModel

func UseModel(db *gorm.DB, values ...any)

Types

type Migration

type Migration struct {
	Version string
	Query   string
}

type Model

type Model struct {
	Sample      any                 `json:"sample"`
	Value       reflect.Value       `json:"-"`
	Type        reflect.Type        `json:"-"`
	Kind        reflect.Kind        `json:"-"`
	Table       string              `json:"table"`
	Name        string              `json:"name"`
	Package     string              `json:"package"`
	PackagePath string              `json:"package_path"`
	PrimaryKey  []string            `json:"primary_key"`
	Joins       map[string][]string `json:"joins"`
	Schema      *schema.Schema      `json:"-"`
	Statement   *gorm.Statement     `json:"-"`
}

func Find

func Find(name string) *Model

func (Model) Join

func (m Model) Join(joins ...*Model) ([]string, []string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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