dbmeta

package
v0.0.0-...-a30d4c3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(dst interface{}, src interface{}) error

func FmtFieldName

func FmtFieldName(s string) string

fmtFieldName formats a string as a struct key

Example:

fmtFieldName("foo_id")

Output: FooID

Types

type BootstrapInfo

type BootstrapInfo struct {
	Config *config.Config
}

type Helper

type Helper struct {
	Cols []*sql.ColumnType
}

func (*Helper) HasField

func (h *Helper) HasField(col string) bool

type ModelInfo

type ModelInfo struct {
	PackageName     string
	StructName      string
	ShortStructName string
	TableName       string
	Fields          []string
	Helper          *Helper
	Config          *config.Config
}

func GenerateStruct

func GenerateStruct(db *sql.DB, tableName string, cfg *config.Config) *ModelInfo

GenerateStruct generates a struct for the given table. func GenerateStruct(db *sql.DB, tableName string, structName string, pkgName string, jsonAnnotation bool, gormAnnotation bool, gureguTypes bool, cfg *config.Config) *ModelInfo {

type QueryInfo

type QueryInfo struct {
	Config *config.Config
}

Jump to

Keyboard shortcuts

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