Skip to content

Derive the base-to-collection type-relation registry#73

Merged
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:feat/type-relations
Jul 23, 2026
Merged

Derive the base-to-collection type-relation registry#73
estebanzimanyi merged 1 commit into
MobilityDB:masterfrom
estebanzimanyi:feat/type-relations

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

A base type T parameterises four independent template classes — Temporal<T>, Set<T>, Span<T> and SpanSet<T>. Resolving the concrete collection type of a value-domain result (SpanSet<float> is floatspanset) is a static type-system fact, needed at generation time by every binding, but it lives only in the positional catalog arrays of meos_catalog.c.

This parses those arrays (MEOS_SETTYPE_CATALOG, MEOS_SPANTYPE_CATALOG, MEOS_SPANSETTYPE_CATALOG, MEOS_TEMPTYPE_CATALOG) and MEOS_TYPE_NAMES, inverts them, and attaches idl["typeRelations"].byBase: for each base type name, the names of its set, span, span set and temporal types — absent when the base has none, so text carries no span and geometry no span set.

float8: {temporal: tfloat, set: floatset, span: floatspan, spanset: floatspanset}
int4:   {temporal: tint,   set: intset,   span: intspan,   spanset: intspanset}
text:   {temporal: ttext,  set: textset}

A binding projects the concrete collection wrapper from this registry rather than hard-coding the mapping — for all present and future bindings, with no new public MEOS API surface. The parse degrades to no attachment (never a fabricated map) when the source tree is unavailable. A unit test covers the parse and inversion (hermetic fixture) plus the canonical numeric mappings against the live source.

A base type T parameterises four independent template classes — Temporal<T>,
Set<T>, Span<T> and SpanSet<T>. Resolving the concrete collection type of a
value-domain result (SpanSet<float> is floatspanset) is a static type-system
fact, needed at generation time by every binding, but it lives only in the
positional catalog arrays of meos_catalog.c.

Parse those arrays (MEOS_SETTYPE_CATALOG, MEOS_SPANTYPE_CATALOG,
MEOS_SPANSETTYPE_CATALOG, MEOS_TEMPTYPE_CATALOG) and MEOS_TYPE_NAMES, invert
them, and attach idl["typeRelations"].byBase: for each base type name, the
names of its set, span, span set and temporal types (absent when the base has
none, so text carries no span). A binding projects the concrete collection
wrapper from this registry rather than hard-coding the mapping.

The parse degrades to no attachment when the source tree is unavailable, never
a fabricated map.
@estebanzimanyi
estebanzimanyi merged commit a157ab2 into MobilityDB:master Jul 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant