Added nested structure scan.

This commit is contained in:
sub0Zero 2019-03-09 14:20:44 +01:00 committed by zer0sub
parent 7d7dda3b7a
commit 3f4b5c69d3
5 changed files with 124 additions and 21 deletions

View file

@ -28,7 +28,7 @@ func (c ColumnInfo) ToGoVarName() string {
func (c ColumnInfo) ToGoType() string {
typeStr := c.GoBaseType()
if c.IsNullable {
if c.IsNullable || c.TableInfo.IsForeignKey(c.Name) {
return "*" + typeStr
}
@ -54,6 +54,8 @@ func (c ColumnInfo) GoBaseType() string {
return "[]byte"
case "text":
return "string"
case "numeric", "real":
return "float64"
default:
return "string"
}