From 1fd0e0860b853a7dab1e94c81fd97066e1afc847 Mon Sep 17 00:00:00 2001 From: ZhengYang Date: Fri, 5 Sep 2014 10:03:21 +0800 Subject: [PATCH] support for json type --- g_appcode.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/g_appcode.go b/g_appcode.go index fa7a83a..aca7023 100644 --- a/g_appcode.go +++ b/g_appcode.go @@ -129,6 +129,7 @@ var typeMappingPostgres = map[string]string{ "ARRAY": "string", // array "USER-DEFINED": "string", // user defined "uuid": "string", // uuid + "json": "string", // json } // Table represent a table in a database @@ -891,7 +892,7 @@ func formatSourceCode(filename string) { func camelCase(in string) string { tokens := strings.Split(in, "_") for i := range tokens { - tokens[i] = strings.Title(strings.Trim(tokens[i], " ")) + tokens[i] = strings.Title(strings.Trim(tokens[i], " ")) } return strings.Join(tokens, "") } @@ -920,7 +921,7 @@ func isSQLBitType(t string) bool { return t == "bit" } func isSQLStrangeType(t string) bool { - return t == "interval" || t == "uuid" + return t == "interval" || t == "uuid" || t == "json" } // extractColSize extracts field size: e.g. varchar(255) => 255