fix: readers and linting issues
Some checks failed
CI / Test (1.24) (push) Failing after -24m50s
CI / Test (1.25) (push) Failing after -24m42s
CI / Build (push) Successful in -25m49s
CI / Lint (push) Successful in -25m36s

This commit is contained in:
2025-12-19 22:28:24 +02:00
parent d9225a7310
commit aad5db5175
16 changed files with 1237 additions and 80 deletions

View File

@@ -626,17 +626,14 @@ func (r *Reader) parseColumn(fieldName string, fieldType ast.Expr, tag string, s
// - nullzero tag means the field is nullable (can be NULL in DB)
// - absence of nullzero means the field is NOT NULL
// - primitive types (int64, bool, string) are NOT NULL by default
column.NotNull = true
// Primary keys are always NOT NULL
if strings.Contains(bunTag, "nullzero") {
column.NotNull = false
} else if r.isNullableGoType(fieldType) {
// SqlString, SqlInt, etc. without nullzero tag means NOT NULL
column.NotNull = true
} else {
// Primitive types are NOT NULL by default
column.NotNull = true
column.NotNull = !r.isNullableGoType(fieldType)
}
// Primary keys are always NOT NULL
if column.IsPrimaryKey {
column.NotNull = true
}