From 99c1cc6e914c9ffee02d2de3663707e7d24f373e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 8 Oct 2013 11:30:56 +0800 Subject: [PATCH] added docs docs/AutoMap.md to describe how go type converted to database type --- docs/AutoMap.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 docs/AutoMap.md diff --git a/docs/AutoMap.md b/docs/AutoMap.md new file mode 100644 index 00000000..8a80113e --- /dev/null +++ b/docs/AutoMap.md @@ -0,0 +1,65 @@ +When a struct auto mapping to a database's table, the below table describes how they change to each other: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
go type + value methodxorm type +
implemented ConversionConversion.ToDB / Conversion.FromDBText
int, int8, int16, int32, uint, uint8, uint16, uint32 Int
int64, uint64BigInt
float32Float
float64Double
complex64, complex128json.Marshal / json.UnMarshalVarchar(64)
[]uint8Blob
array, slice, map except []uint8json.Marshal / json.UnMarshalText
bool1 or 0Bool
stringVarchar(255)
time.TimeDateTime
cascade structprimary key field valueBigInt
structjson.Marshal / json.UnMarshalText
+ Others + + Text +
\ No newline at end of file