feat(bun): 🎉 Enhance nullability handling in column parsing
All checks were successful
All checks were successful
* Introduce explicit nullability markers in column tags. * Update logic to infer nullability based on Go types when no markers are present. * Ensure correct tags are generated for nullable and non-nullable fields.
This commit is contained in:
@@ -192,8 +192,11 @@ func (tm *TypeMapper) BuildBunTag(column *models.Column, table *models.Table) st
|
||||
}
|
||||
|
||||
// Nullable (Bun uses nullzero for nullable fields)
|
||||
// and notnull tag for explicitly non-nullable fields
|
||||
if !column.NotNull && !column.IsPrimaryKey {
|
||||
parts = append(parts, "nullzero")
|
||||
} else if column.NotNull && !column.IsPrimaryKey {
|
||||
parts = append(parts, "notnull")
|
||||
}
|
||||
|
||||
// Check for indexes (unique indexes should be added to tag)
|
||||
|
||||
Reference in New Issue
Block a user