Added nested structure scan.
This commit is contained in:
parent
7d7dda3b7a
commit
3f4b5c69d3
5 changed files with 124 additions and 21 deletions
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue