{"record":{"id":"ca02637af00e69e1","repo":"jackc/pgx","slug":"field-s-has-empty-s-tag","errorCode":null,"errorMessage":"field %s has empty `%s` tag","messagePattern":"field (.+?) has empty `(.+?)` tag","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"named_args.go","lineNumber":144,"sourceCode":"\t\tft := sf.Type\n\t\tif ft.Kind() == reflect.Pointer {\n\t\t\tft = ft.Elem()\n\t\t}\n\t\tif ft.Kind() == reflect.Struct {\n\t\t\treturn \"\", false, nil\n\t\t}\n\t}\n\n\tdbTag, dbTagPresent := sf.Tag.Lookup(structTagKey)\n\tif dbTagPresent {\n\t\tdbTag, _, _ = strings.Cut(dbTag, \",\")\n\t}\n\tif dbTag == \"-\" {\n\t\treturn \"\", false, nil\n\t}\n\tif dbTagPresent {\n\t\tif dbTag == \"\" {\n\t\t\treturn \"\", false, fmt.Errorf(\"field %s has empty `%s` tag\", sf.Name, structTagKey)\n\t\t}\n\t\treturn dbTag, true, nil\n\t}\n\n\treturn sf.Name, true, nil\n}\n\ntype namedArg string\n\ntype sqlLexer struct {\n\tsrc     string\n\tstart   int\n\tpos     int\n\tnested  int // multiline comment nesting level.\n\tstateFn stateFn\n\tparts   []any\n\n\tnameToOrdinal map[namedArg]int","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/named_args.go#L126-L162","documentation":"A struct field carries an explicitly present but empty `db:` tag (e.g. db:\"\"). An empty tag is treated as a configuration error rather than falling back to the field name, since it likely indicates an unfinished edit.","triggerScenarios":"Thrown at named_args.go:144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fill in the tag value or remove the empty tag entirely","Use db:\"-\" if the field should be skipped"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}