{"record":{"id":"5cfbbc11e8c7817c","repo":"geektutu/7days-golang","slug":"invalid-sql-type-s-s-5cfbbc","errorCode":null,"errorMessage":"invalid sql type %s (%s)","messagePattern":"invalid sql type (.+?) \\((.+?)\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gee-orm/day6-transaction/dialect/sqlite3.go","lineNumber":38,"sourceCode":"\tcase reflect.Bool:\n\t\treturn \"bool\"\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,\n\t\treflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uintptr:\n\t\treturn \"integer\"\n\tcase reflect.Int64, reflect.Uint64:\n\t\treturn \"bigint\"\n\tcase reflect.Float32, reflect.Float64:\n\t\treturn \"real\"\n\tcase reflect.String:\n\t\treturn \"text\"\n\tcase reflect.Array, reflect.Slice:\n\t\treturn \"blob\"\n\tcase reflect.Struct:\n\t\tif _, ok := typ.Interface().(time.Time); ok {\n\t\t\treturn \"datetime\"\n\t\t}\n\t}\n\tpanic(fmt.Sprintf(\"invalid sql type %s (%s)\", typ.Type().Name(), typ.Kind()))\n}\n\n// TableExistSQL returns SQL that judge whether the table exists in database\nfunc (s *sqlite3) TableExistSQL(tableName string) (string, []interface{}) {\n\targs := []interface{}{tableName}\n\treturn \"SELECT name FROM sqlite_master WHERE type='table' and name = ?\", args\n}\n","sourceCodeStart":20,"sourceCodeEnd":46,"githubUrl":"https://github.com/geektutu/7days-golang/blob/cf3644382101dc13e7fd92e8f5c66cabc51bcd3b/gee-orm/day6-transaction/dialect/sqlite3.go#L20-L46","documentation":"Panicked type-mapping failure in sqlite3 dialect DataTypeOf: the schema field's reflect.Kind has no SQLite column-type mapping in the switch (e.g. map, chan, func, pointer, complex). It fires during table migration when a struct field uses an unsupported Go type.","triggerScenarios":"Thrown at gee-orm/day6-transaction/dialect/sqlite3.go:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change the struct field to a supported type: bool, integer, float, string, time.Time, or slice/array (blob).","Add a case to DataTypeOf for the kind you need (e.g. return \"text\" for pointers/JSON-serializable types).","Exclude unsupported fields from the schema before migration."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf3644382101dc13e7fd92e8f5c66cabc51bcd3b","analyzedAt":"2026-09-03T18:31:24.087Z","contentChangedAt":"2026-09-03T18:31:24.087Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}