Skip to content

Pass NULL for a nil string MEOS accepts as NULL - #31

Merged
estebanzimanyi merged 2 commits into
MobilityDB:mainfrom
estebanzimanyi:codegen/nullable-string-accepts-nil
Oct 27, 2026
Merged

estebanzimanyi merged 2 commits into
MobilityDB:mainfrom
estebanzimanyi:codegen/nullable-string-accepts-nil

Conversation

@estebanzimanyi

@estebanzimanyi estebanzimanyi commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

A char * or text * argument the catalog lists in shape.nullable is a *string
in the functions package, and nil passes NULL to MEOS; any other string
argument stays a string. The types package passes the *string through to the
wrapper, so its methods over those functions take it too. Eight wrappers
take one: GeoAsEWKB, GeoAsGeojson, GeoAsHexewkb, WKBVariantFromEndian,
TemporalAsMFJSON, TrgeometryAsTsequence, TrgeometryAsTsequenceset and
MeosSetPointcloudSchemasXml.

Witness: ExampleTemporalAsMFJSON_nilSrs writes the MF-JSON of a temporal
point with no "crs" member for a nil srs and with "EPSG:4326" for that srs.

Measured: against the libmeos of MobilityDB a23e01a60b, the gomeos package
runs its 122 examples, the functions and types packages build, the
portable-parity test passes, and the types package keeps its 1435 methods
with 156 deferred, as with string arguments.

Why: MEOS states the arguments it accepts as NULL with the @nullable tag,
and a binding that cannot pass NULL to them cannot ask what MEOS answers.

The functions and types packages are regenerated from the catalog of
MobilityDB master a23e01a60b, and the hand-written calls follow the MEOS
signatures there: the distances, lengths and speed of a temporal point and
the ever, always and temporal within distance take the model of the earth
last, which they are given as the spheroid, the model MobilityDB defaults
to and the one MEOS measures a geography on; temporal_as_mfjson takes its
options as bits, the bounding box being bit 1; and the MF-JSON call passes
the reference system string it frees.

Witness: the gomeos package builds against the libmeos of a23e01a60b and
its 121 examples pass with TZ=UTC; the functions and types packages build,
and the portable-parity test passes.

Why: the committed packages and the hand-written calls are what a go get
consumer compiles, and they compile against the MEOS they name.
A char * or text * argument the catalog lists in shape.nullable is a *string
in the functions package, and nil passes NULL to MEOS; any other string
argument stays a string. The types package passes the *string through to the
wrapper, so its methods over those functions take it too. Eight wrappers
take one: GeoAsEWKB, GeoAsGeojson, GeoAsHexewkb, WKBVariantFromEndian,
TemporalAsMFJSON, TrgeometryAsTsequence, TrgeometryAsTsequenceset and
MeosSetPointcloudSchemasXml.

Witness: ExampleTemporalAsMFJSON_nilSrs writes the MF-JSON of a temporal
point with no "crs" member for a nil srs and with "EPSG:4326" for that srs.

Measured: against the libmeos of MobilityDB a23e01a60b, the gomeos package
runs its 122 examples, the functions and types packages build, the
portable-parity test passes, and the types package keeps its 1435 methods
with 156 deferred, as with string arguments.

Why: MEOS states the arguments it accepts as NULL with the @nullable tag,
and a binding that cannot pass NULL to them cannot ask what MEOS answers.
@estebanzimanyi
estebanzimanyi merged commit e5a46db into MobilityDB:main Oct 27, 2026
2 of 3 checks passed
@estebanzimanyi
estebanzimanyi deleted the codegen/nullable-string-accepts-nil branch October 27, 2026 14:53
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