Bind the cataloged interval_in instead of hand-wrapping pg_interval_in - #11
Merged
estebanzimanyi merged 2 commits intoAug 15, 2026
Merged
Conversation
The repository runs only a docs deployment, so nothing regenerates the bindings, compares them against the committed sources, or type-checks the result. Eleven hand-written wrappers reached main without consulting the MEOS error state partly for that reason: the generator asserts the invariant, but the assertion only fires when somebody regenerates by hand. The job regenerates from the committed catalog, fails on any drift against core/functions/functions.generated.ts and core/c-src/bindings.c, and type-checks. Drift means either the generator changed without its output being refreshed or the output was edited directly, and both leave a surface no catalog projection produces. Running the runtime tests needs the WebAssembly module, which the Docker emscripten target builds and the repository does not commit, so that job is separate work.
The binding hand-wrapped pg_interval_in: a C wrapper forward-declaring the symbol, a TypeScript export, and a call site in Temporal. The catalog carries pg_interval_in as internal (pgtypes.h) and the canonical interval_in as public, so the binding exposed an internal spelling of a function it already had a public name for, and every other binding binds the public one. interval_in is dropped by the generator's header allow-list, which omits the header the PostgreSQL-compat base I/O is attributed to. MEOS splices those declarations into the installed <meos.h> at build time, so they are reachable through an umbrella the preamble already includes; the omission is what forced the hand wrapper. The allow-list names both spellings of that header because the catalog attribution has moved between them. Emitting it brings the rest of the pg-compat base I/O with it -- bool, date, time, timestamp, interval, text and float8 in/out -- 22 functions, each declared in the installed <meos.h> and exported by libmeos. The generator's header allow-list itself stays. Replacing it with a projection on the catalog's own api field is the larger change, and it needs the umbrella attribution of the remaining public-in-subdir-header functions first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The branch carries the build-CI commit beneath it; the second commit is the one to review.
The binding calls the catalog canonical
interval_in, and the hand-writtenpg_interval_inwrapper goes away: its C forward declaration, its TypeScript export, and its call site in Temporal.The catalog carries
pg_interval_inas internal, declared inpgtypes.h, andinterval_inas public. The hand wrapper therefore exposed an internal spelling of a function the catalog already names publicly, and which every other binding binds.interval_inis dropped by the generator header allow-list, which omits the header the PostgreSQL-compat base I/O is attributed to. MEOS splices those declarations into the installed<meos.h>at build time, so they are reachable through an umbrella the preamble already includes, and the omission is what forces the hand wrapper. The allow-list names both spellings of that header, since the catalog attribution moves betweenpostgres_ext_defs.in.handpg_interval.h.Admitting it brings the rest of the pg-compat base I/O with it — bool, date, time, timestamp, interval, text and float8 in/out, 22 functions. Each is declared in the installed
<meos.h>and exported bylibmeos(nm -D).The header allow-list itself stays. Replacing it with a projection on the catalog
apifield is the larger change, and it needs the umbrella attribution of the remaining public-in-subdir-header functions first.