codegen: style fixes ('int64' -> 'int', 'SELECT' -> 'select')
This commit is contained in:
parent
c08f12e275
commit
eee6714918
@ -52,7 +52,7 @@ func GenerateModelAST(table schema.Table) *ast.GenDecl {
|
|||||||
} else if strings.HasSuffix(col.Name, "_at") {
|
} else if strings.HasSuffix(col.Name, "_at") {
|
||||||
typeName = "Timestamp"
|
typeName = "Timestamp"
|
||||||
} else {
|
} else {
|
||||||
typeName = "int64"
|
typeName = "int"
|
||||||
}
|
}
|
||||||
case "text":
|
case "text":
|
||||||
typeName = "string"
|
typeName = "string"
|
||||||
@ -258,12 +258,12 @@ func GenerateGetAllItemsFunc(tbl schema.Table) *ast.FuncDecl {
|
|||||||
&ast.UnaryExpr{Op: token.AND, X: ast.NewIdent("ret")},
|
&ast.UnaryExpr{Op: token.AND, X: ast.NewIdent("ret")},
|
||||||
&ast.BinaryExpr{
|
&ast.BinaryExpr{
|
||||||
X: &ast.BinaryExpr{
|
X: &ast.BinaryExpr{
|
||||||
X: &ast.BasicLit{Kind: token.STRING, Value: "`SELECT `"},
|
X: &ast.BasicLit{Kind: token.STRING, Value: "`select `"},
|
||||||
Op: token.ADD,
|
Op: token.ADD,
|
||||||
Y: SQLFieldsConstIdent(tbl),
|
Y: SQLFieldsConstIdent(tbl),
|
||||||
},
|
},
|
||||||
Op: token.ADD,
|
Op: token.ADD,
|
||||||
Y: &ast.BasicLit{Kind: token.STRING, Value: "` FROM " + tbl.TableName + "`"},
|
Y: &ast.BasicLit{Kind: token.STRING, Value: "` from " + tbl.TableName + "`"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user