Skip to content

native-api: bind the Firebird 4/5 interfaces, IBatch included - #178

Merged
asfernandes merged 1 commit into
asfernandes:masterfrom
mariuz:ibatch-native-api
Oct 17, 2026
Merged

asfernandes merged 1 commit into
asfernandes:masterfrom
mariuz:ibatch-native-api

Conversation

@mariuz

@mariuz mariuz commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

The cloop definitions (firebird.cloop.json) and the bundled C++ headers were the Firebird 3 interface set, which has no IBatch: Statement and Attachment at version 3, no Batch or BatchCompletionState.

Regenerated from Firebird 5.0.3: firebird.cloop.json from its FirebirdInterface.idl (cloop's json output), the bundled headers from the 5.0.3 release's include/firebird, then yarn generate, the eslint-disable header and eslint --fix on cloop-gen.ts, as the current file was made (regenerating the Firebird 3 definitions this way reproduces the committed cloop-gen.h and cloop-gen.ts exactly).

New in the bindings: Batch, BatchCompletionState, Statement.createBatch, Attachment.createBatch, XpbBuilder.BATCH, MessageMetadata.getAlignment and getAlignedLength, and the rest of the Firebird 4/5 additions. patch.ts drops the methods node-cloop-gen cannot bind, as it already does for formatStatus and the trace interfaces: the Util time zone decode*Tz methods and DecFloat16/DecFloat34/Int128 toString (they write into a caller's char buffer), ReplicatedField.getData (an untyped pointer), and the profiler plugin interfaces.

A Firebird 3 client library keeps working: calling a Firebird 4 method on it fails with "Interface IStatement version too old: expected 4, found 3", and a Firebird 4+ client against a Firebird 3 server with "feature is not supported".

Tests: three Batch tests (one message per add and several at the aligned length, TAG_MULTIERROR with a duplicate key, and Attachment.createBatch), skipped on a client older than Firebird 4. The whole repository's tests pass against Firebird 5.0.3 (native-api 26, driver-native 34, driver-wire 79), and native-api's against Firebird 3.0.11 (23 passed, the 3 batch tests skipped).

Claude-Session: https://claude.ai/code/session_01W28aSsivpL4yXuUu8hiVX9

The cloop definitions (firebird.cloop.json) and the bundled C++ headers
were the Firebird 3 interface set, which has no IBatch: Statement and
Attachment at version 3, no Batch or BatchCompletionState.

Regenerated from Firebird 5.0.3: firebird.cloop.json from its
FirebirdInterface.idl (cloop's json output), the bundled headers from
the 5.0.3 release's include/firebird, then `yarn generate`, the
eslint-disable header and `eslint --fix` on cloop-gen.ts, as the
current file was made (regenerating the Firebird 3 definitions this way
reproduces the committed cloop-gen.h and cloop-gen.ts exactly).

New in the bindings: Batch, BatchCompletionState, Statement.createBatch,
Attachment.createBatch, XpbBuilder.BATCH, MessageMetadata.getAlignment
and getAlignedLength, and the rest of the Firebird 4/5 additions.
patch.ts drops the methods node-cloop-gen cannot bind, as it already
does for formatStatus and the trace interfaces: the Util time zone
decode*Tz methods and DecFloat16/DecFloat34/Int128 toString (they write
into a caller's char buffer), ReplicatedField.getData (an untyped
pointer), and the profiler plugin interfaces.

A Firebird 3 client library keeps working: calling a Firebird 4 method
on it fails with "Interface IStatement version too old: expected 4,
found 3", and a Firebird 4+ client against a Firebird 3 server with
"feature is not supported".

Tests: three Batch tests (one message per add and several at the
aligned length, TAG_MULTIERROR with a duplicate key, and
Attachment.createBatch), skipped on a client older than Firebird 4. The
whole repository's tests pass against Firebird 5.0.3 (native-api 26,
driver-native 34, driver-wire 79), and native-api's against Firebird
3.0.11 (23 passed, the 3 batch tests skipped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W28aSsivpL4yXuUu8hiVX9
@asfernandes
asfernandes merged commit 277f855 into asfernandes:master Oct 17, 2026
16 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.

3 participants