generator

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = false

Debug level logging

Functions

func FmtFieldName

func FmtFieldName(s string) string

fmtFieldName formats a string as a struct key

Example:

fmtFieldName("foo_id")

Output: FooID

func Generate

func Generate(columnTypes map[string]map[string]string, tableName string, structName string, pkgName string, jsonAnnotation bool, gormAnnotation bool, gureguTypes bool, extraColumns string, extraStucts string) ([]byte, error)

Generate Given a Column map with datatypes and a name structName, attempts to generate a struct definition

func GenerateGrapql

func GenerateGrapql(columnTypes map[string]map[string]string, tableName string, structName string, pkgName string, jsonAnnotation bool, gormAnnotation bool, gureguTypes bool, extraColumns string, extraStucts string, Subs []string, isInpute bool) ([]byte, error)

func GenerateGrapqlOrder

func GenerateGrapqlOrder(columnTypes map[string]map[string]string, tableName string, structName string, pkgName string, jsonAnnotation bool, gormAnnotation bool, gureguTypes bool, extraColumns string, extraStucts string) ([]byte, error)

func GenerateOnlyStruct

func GenerateOnlyStruct(columnTypes map[string]map[string]string, tableName string, structName string, pkgName string, jsonAnnotation bool, gormAnnotation bool, gureguTypes bool, extraColumns string, extraStucts string) ([]byte, error)

func GenerateWithImports

func GenerateWithImports(otherPackage string, columnTypes map[string]map[string]string, tableName string, structName string, pkgName string, jsonAnnotation bool, gormAnnotation bool, gureguTypes bool, extraColumns string, extraStucts string) ([]byte, error)

func GenerateWithImportsNoTime

func GenerateWithImportsNoTime(otherPackage string, columnTypes map[string]map[string]string, tableName string, structName string, pkgName string, jsonAnnotation bool, gormAnnotation bool, gureguTypes bool, extraColumns string, extraStucts string) ([]byte, error)

func GetColumns

func GetColumns(db *sql.DB, dbTable string, hiddenColumns []string) (string, error)

func GetColumnsFromSQLlTable

func GetColumnsFromSQLlTable(db *sql.DB, dbTable string, hiddenColumns []string) (*map[string]map[string]string, error)

func GetOnlyOneField

func GetOnlyOneField(db *sql.DB, dbTable string, oneField string) (*map[string]map[string]string, error)

func GetStruct

func GetStruct(table string)

func StringifyFirstChar

func StringifyFirstChar(str string) string

convert first character ints to strings

func TableColumns

func TableColumns(table string, hiddenColumns []string) string

func TableToGraphql

func TableToGraphql(table string, hiddenColumns []string, Subs []string, isInpute bool) string

func TableToGraphqlOrderBy

func TableToGraphqlOrderBy(table string, hiddenColumns []string) string

func TableToStruct

func TableToStruct(table string, hiddenColumns []string, pkgName string, Subs []string) string

func TableToStructNoTime

func TableToStructNoTime(table string, hiddenColumns []string, pkgName string) string

Types

This section is empty.

Directories

Path Synopsis
initialModels

Jump to

Keyboard shortcuts

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