Documentation ¶
Index ¶
Constants ¶
View Source
const ( MySQL = "mysql" PostgreSQL = "postgreSQL" SQLite = "sqlite" )
View Source
const (
DefaultCfg = "application"
)
Variables ¶
View Source
var ( RootDir string Scope *do.RootScope Cfg *viper.Viper )
View Source
var TypeMappings = []lo.Tuple4[GoType, string, string, string]{
{
A: "string",
B: "varchar",
C: "varchar",
D: "text",
},
{
A: "bool",
B: "boolean",
C: "boolean",
D: "integer",
},
{
A: "int8",
B: "tinyint",
C: "int8",
D: "integer",
},
{
A: "uint8",
B: "tinyint unsigned",
C: "int8",
D: "integer",
},
{
A: "byte",
B: "tinyint unsigned",
C: "int8",
D: "integer",
},
{
A: "int16",
B: "smallint",
C: "smallint",
D: "integer",
},
{
A: "uint16",
B: "smallint",
C: "smallint",
D: "integer",
},
{
A: "int32",
B: "int",
C: "integer",
D: "integer",
},
{
A: "rune",
B: "int",
C: "integer",
D: "integer",
},
{
A: "uint32",
B: "int",
C: "integer",
D: "integer",
},
{
A: "int64",
B: "bigint",
C: "bigint",
D: "integer",
},
{
A: "uint64",
B: "bigint",
C: "bigint",
D: "integer",
},
{
A: "float32",
B: "float",
C: "double precision",
D: "double precision",
},
{
A: "float64",
B: "decimal",
C: "decimal",
D: "decimal",
},
{
A: "time",
B: "timestamp",
C: "timestamp",
D: "datetime",
},
}
Functions ¶
Types ¶
type Attribute ¶
type Attribute string
const ( // DBTag struct tag name DBTag = "db" // AutoUpdateTime attribute tag with `aut` will be set to time.Now() for update AutoUpdateTime Attribute = "aut" // AutoCreateTime attribute tag with `act` will be set to time.Now() for creation AutoCreateTime Attribute = "act" // PK identify a column is primary key PK Attribute = "pk" // Ignore identify this attribute would not map to database column Ignore Attribute = "ignore" // Name database column name Name Attribute = "name" // Type database column type Type Attribute = "type" )
Click to show internal directories.
Click to hide internal directories.