Skip to content

Commit

Permalink
feat(generate): add real/numeric type mapping for sqlite (go-gorm#417)
Browse files Browse the repository at this point in the history
* feat(generate): add real type mapping for sqlite

* feat: add numeric
  • Loading branch information
tr1v3r authored Apr 18, 2022
1 parent baa69ce commit 2f065f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/model/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ func (g *KeyWords) Contain(text string) bool {
var (
defaultDataType = "string"
dataType dataTypeMap = map[string]dataTypeMapping{
"int": (func(string) string { return "int32" }),
"int": func(string) string { return "int32" },
"numeric": func(string) string { return "int32" },
"integer": func(string) string { return "int32" },
"smallint": func(string) string { return "int32" },
"mediumint": func(string) string { return "int32" },
"bigint": func(string) string { return "int64" },
"float": func(string) string { return "float32" },
"real": func(string) string { return "float64" },
"double": func(string) string { return "float64" },
"decimal": func(string) string { return "float64" },
"char": func(string) string { return "string" },
Expand Down

0 comments on commit 2f065f7

Please sign in to comment.