|
@@ -66,6 +66,27 @@ func setupConnections(engine *xorm.Engine) {
|
|
|
engine.SetMaxIdleConns(CONNECTION_LIMIT)
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+------------------------------+---------------------------------------+------------
|
|
|
+go type's kind value method xorm type
|
|
|
+------------------------------+---------------------------------------+------------
|
|
|
+implemented Conversion Conversion.ToDB / Conversion.FromDB Text
|
|
|
+int, int8, int16, int32 Int
|
|
|
+uint, uint8, uint16, uint32 Int
|
|
|
+int64, uint64 BigInt
|
|
|
+float32 Float
|
|
|
+float64 Double
|
|
|
+complex64, complex128 json.Marshal / json.UnMarshal Varchar(64)
|
|
|
+[]uint8 Blob
|
|
|
+array, slice, other maps json.Marshal / json.UnMarshal Text
|
|
|
+bool 1 or 0 Bool
|
|
|
+string Varchar(255)
|
|
|
+time.Time DateTime
|
|
|
+cascade struct primary key field value BigInt
|
|
|
+struct json.Marshal / json.UnMarshal Text
|
|
|
+Others Text
|
|
|
+------------------------------+---------------------------------------+------------
|
|
|
+ */
|
|
|
func setupMapping(engine *xorm.Engine) {
|
|
|
same := core.SameMapper{}
|
|
|
gonic := core.GonicMapper{}
|