Skip to content

Commit 3f76054

Browse files
rustyconoverclaude
andcommitted
Generate typed C++ protocol records for the DuckDB extension
vgi.codegen.cpp_records emits vgi_protocol_records.hpp (one plain struct per protocol record, one enum class per protocol enum, Arrow only forward- declared) and vgi_protocol_records.cpp (ToBatch/FromBatch per record over the extension's vgi_wire_codec runtime). Records, names and enums are the ones csharp_types derives; each record's ARROW_SCHEMA is the authority. regen_generated.py gains the two targets and a VGI_EXTENSION_ROOT override so an extension worktree can be regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent de27b93 commit 3f76054

2 files changed

Lines changed: 575 additions & 0 deletions

File tree

‎scripts/regen_generated.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
("vgi.codegen.cpp_constants", "src/generated/vgi_protocol_constants.hpp", "vgi"),
3838
("vgi.codegen.cpp_protocol_version", "src/generated/vgi_protocol_version.hpp", "vgi"),
3939
("vgi.codegen.cpp_protocol_name", "src/generated/vgi_protocol_names.hpp", "vgi"),
40+
("vgi.codegen.cpp_records:hpp", "src/generated/vgi_protocol_records.hpp", "vgi"),
41+
("vgi.codegen.cpp_records:cpp", "src/generated/vgi_protocol_records.cpp", "vgi"),
4042
# The secret protocol's three artifacts were checked in but never listed here,
4143
# so `--check` reported "no drift" over a stale secret header. Listed now: a
4244
# regen script that silently skips an artifact is worse than no script, because
@@ -90,6 +92,8 @@
9092

9193
#: Environment overrides for a checkout's location (``VGI_TYPESCRIPT_ROOT=...``).
9294
_ROOT_ENV: dict[str, str] = {b.repo: b.root_env for b in _REGISTRY_BACKENDS}
95+
# The DuckDB extension checkout (e.g. a worktree of it).
96+
_ROOT_ENV.setdefault("vgi", "VGI_EXTENSION_ROOT")
9397

9498

9599
def _repo_root(name: str) -> Path | None:

0 commit comments

Comments
 (0)