Repository navigation
native-api: bind the Firebird 4/5 interfaces, IBatch included - #178
Merged
Merged
Conversation
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
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 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 andeslint --fixon 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