Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEmpty ¶
IsEmpty reports whether v should be treated as "empty" for omitempty semantics.
Container emptiness follows the DMS wire shape: arrays/lists are empty only at length zero, and map/object/struct carriers for M are empty only when they have zero entries/declared fields. time.Time retains its native zero rule.
func IsSparseUpdateEmpty ¶
IsSparseUpdateEmpty reports whether an omitempty field should remain unselected during Go's argument-less Update() inference. This preserves the historical sparse-selection behavior independently of DMS emptiness, which applies only after a field is explicitly selected.
Types ¶
type LegacyAliasResolver ¶
type LegacyAliasResolver func(field reflect.StructField) (aliases []string, skip bool, err error)
LegacyAliasResolver resolves the legacy container aliases that older helper surfaces used when anonymous embedded structs were encoded as nested maps.
When skip is true, no legacy container aliases are recorded for the field. This is useful for callers that treat tag-based skips (for example "-") as ineligible for compatibility lookup while still wanting the promoted leaf fields themselves to remain visible.
type LegacyContainerPlan ¶
type LegacyContainerPlan struct {
IndexPath []int
Aliases []string
Field reflect.StructField
}
LegacyContainerPlan records one anonymous embedded struct container on the path to a promoted visible field, along with the aliases legacy helper surfaces used for nested compatibility lookups.
type VisibleFieldPlan ¶
type VisibleFieldPlan struct {
IndexPath []int
LegacyContainers []LegacyContainerPlan
Field reflect.StructField
}
VisibleFieldPlan describes one exported visible field on a struct, including promoted fields that arrived through exported anonymous embedded structs. Anonymous struct containers themselves are intentionally omitted.
func BuildVisibleFieldPlan ¶
func BuildVisibleFieldPlan(modelType reflect.Type, aliasResolver LegacyAliasResolver) ([]VisibleFieldPlan, error)
BuildVisibleFieldPlan enumerates exported visible fields for a struct using Go promotion rules. Promoted fields are included only when they arrive through exported anonymous embedded structs, matching TableTheory's current metadata recursion scope. Anonymous struct containers themselves are omitted.