model

package
v1.0.0-Alpha Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateStruct

func GenerateStruct(tableName string, columns []*Column) string

Types

type Column

type Column struct {
	Name                   string `gorm:"column:COLUMN_NAME"`
	Type                   string `gorm:"column:COLUMN_TYPE"`
	IsNullAble             string `gorm:"column:IS_NULLABLE"`
	CharacterMaximumLength *int   `gorm:"column:CHARACTER_MAXIMUM_LENGTH"`
	Extra                  string `gorm:"column:EXTRA"`
	Comment                string `gorm:"column:COLUMN_COMMENT"`
}

func GetColumn

func GetColumn(tableName string) (columns []*Column, err error)

type Table

type Table struct {
	TableName string `gorm:"column:TABLE_NAME"`
	CamelCase string `gorm:"-"`
	Struct    string `gorm:"-"`
	Import    string `gorm:"-"`
	Index     string `gorm:"-"`
}

func GetTables

func GetTables(args string) (tables []*Table, err error)

Jump to

Keyboard shortcuts

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