()
| 204 | } |
| 205 | |
| 206 | func (s *AdapterTests) TestMySQLTypes() { |
| 207 | sess := s.Session() |
| 208 | |
| 209 | type MyType struct { |
| 210 | ID int64 `db:"id,omitempty"` |
| 211 | |
| 212 | JSONMap JSONMap `db:"json_map"` |
| 213 | |
| 214 | JSONObject JSONMap `db:"json_object"` |
| 215 | JSONArray JSONArray `db:"json_array"` |
| 216 | |
| 217 | CustomJSONObject customJSON `db:"custom_json_object"` |
| 218 | AutoCustomJSONObject autoCustomJSON `db:"auto_custom_json_object"` |
| 219 | |
| 220 | CustomJSONObjectPtr *customJSON `db:"custom_json_object_ptr,omitempty"` |
| 221 | AutoCustomJSONObjectPtr *autoCustomJSON `db:"auto_custom_json_object_ptr,omitempty"` |
| 222 | |
| 223 | AutoCustomJSONObjectArray []autoCustomJSON `db:"auto_custom_json_object_array"` |
| 224 | AutoCustomJSONObjectMap map[string]autoCustomJSON `db:"auto_custom_json_object_map"` |
| 225 | |
| 226 | Int64CompatValueJSONArray []int64Compat `db:"integer_compat_value_json_array"` |
| 227 | UIntCompatValueJSONArray uintCompatArray `db:"uinteger_compat_value_json_array"` |
| 228 | StringCompatValueJSONArray []stringCompat `db:"string_compat_value_json_array"` |
| 229 | } |
| 230 | |
| 231 | origMyTypeTests := []MyType{ |
| 232 | MyType{ |
| 233 | Int64CompatValueJSONArray: []int64Compat{1, -2, 3, -4}, |
| 234 | UIntCompatValueJSONArray: []uintCompat{1, 2, 3, 4}, |
| 235 | StringCompatValueJSONArray: []stringCompat{"a", "b", "", "c"}, |
| 236 | }, |
| 237 | MyType{ |
| 238 | Int64CompatValueJSONArray: []int64Compat(nil), |
| 239 | UIntCompatValueJSONArray: []uintCompat(nil), |
| 240 | StringCompatValueJSONArray: []stringCompat(nil), |
| 241 | }, |
| 242 | MyType{ |
| 243 | AutoCustomJSONObjectArray: []autoCustomJSON{ |
| 244 | autoCustomJSON{ |
| 245 | N: "Hello", |
| 246 | }, |
| 247 | autoCustomJSON{ |
| 248 | N: "World", |
| 249 | }, |
| 250 | }, |
| 251 | AutoCustomJSONObjectMap: map[string]autoCustomJSON{ |
| 252 | "a": autoCustomJSON{ |
| 253 | N: "Hello", |
| 254 | }, |
| 255 | "b": autoCustomJSON{ |
| 256 | N: "World", |
| 257 | }, |
| 258 | }, |
| 259 | JSONArray: JSONArray{float64(1), float64(2), float64(3), float64(4)}, |
| 260 | }, |
| 261 | MyType{ |
| 262 | JSONArray: JSONArray{}, |
| 263 | }, |
nothing calls this directly
no test coverage detected