helper

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IntTypeMapping = map[string]string{
	"int":               "int",
	"int unsigned":      "uint",
	"tinyint":           "int8",
	"tinyint unsigned":  "uint8",
	"smallint":          "int16",
	"smallint unsigned": "uint16",
	"bigint":            "int64",
	"bigint unsigned":   "uint64",
	"float":             "float",
	"double":            "float64",
	"decimals":          "float64",
}
View Source
var MysqlTypeMapping = map[string]string{
	"char":     "string",
	"varchar":  "string",
	"tinytext": "string",
	"longtext": "string",
	"text":     "string",

	"bool": "bool",

	"int":               "int",
	"int unsigned":      "uint",
	"tinyint":           "int8",
	"tinyint unsigned":  "uint8",
	"smallint":          "int16",
	"smallint unsigned": "uint16",
	"bigint":            "int64",
	"bigint unsigned":   "uint64",
	"float":             "float",
	"double":            "float64",
	"decimals":          "float64",

	"datetime":  "*time.Time",
	"date":      "*time.Time",
	"timestamp": "*time.Time",
}
View Source
var StringTypeMapping = map[string]string{
	"char":     "string",
	"varchar":  "string",
	"tinytext": "string",
	"longtext": "string",
	"text":     "string",
}

Functions

func DbConn

func DbConn(username, password, host string, port int, database string) *gorm.DB

func FormatFile

func FormatFile(filename string)

func KeyCamel

func KeyCamel(old string) string

func KeyPascal

func KeyPascal(old string) string

func StrFirstToLower

func StrFirstToLower(str string) string

func StrFirstToUpper

func StrFirstToUpper(str string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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