refactor(server): extract wire-level types into server/wire#489
Merged
fuziontech merged 1 commit intomainfrom May 1, 2026
Merged
refactor(server): extract wire-level types into server/wire#489fuziontech merged 1 commit intomainfrom
fuziontech merged 1 commit intomainfrom
Conversation
Carves the small CP↔worker RPC types and PG cancel-request helpers out
of server/ into a new server/wire subpackage with no dependency on
github.com/duckdb/duckdb-go.
Symbols moved:
- BackendKey (from server/server.go)
- GenerateSecretKey + the previously private generateSecretKey
(from server/exports.go and server/conn.go)
- WorkerControlMetadata (from server/worker_control.go)
- WorkerActivationPayload (from server/worker_activation.go), with its
DuckLake field now typed as ducklake.Config directly rather than via
the server.DuckLakeConfig alias
- WorkerCreateSessionPayload, WorkerDestroySessionPayload,
WorkerHealthCheckPayload (from server/worker_control.go)
Backward compatibility preserved via type aliases in
server/worker_control.go and server/worker_activation.go (now thin
alias files), plus a `var GenerateSecretKey = wire.GenerateSecretKey`
re-export in server/exports.go and a `type BackendKey = wire.BackendKey`
alias in server/server.go.
go list -deps ./server/wire | grep duckdb-go # empty
The control plane uses many of these symbols via the existing
server.X spellings; those continue to compile via the aliases. New
code (and the eventual cmd/duckgres-controlplane binary) should
import server/wire directly.
Also drops two now-unused imports from server/conn.go (crypto/rand
and math/big — both were only used by the moved generateSecretKey).
Verified:
- go build ./... clean
- go build -tags kubernetes ./... clean
- go test -short ./server/wire/... ./server/... ./controlplane/...
./duckdbservice/... — all green
- go list -deps ./server/wire | grep duckdb-go is empty
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Carves the small CP↔worker RPC types and PG cancel-request helpers out of
server/into a newserver/wiresubpackage with zeroduckdb-godependency.Symbols moved:
server.BackendKeywire.BackendKey(alias kept in server)server.GenerateSecretKeywire.GenerateSecretKey(re-export var kept)server.WorkerControlMetadatawire.WorkerControlMetadata(alias kept)server.WorkerActivationPayloadwire.WorkerActivationPayload(alias kept)server.WorkerCreateSessionPayloadwire.WorkerCreateSessionPayload(alias kept)server.WorkerDestroySessionPayloadwire.WorkerDestroySessionPayload(alias kept)server.WorkerHealthCheckPayloadwire.WorkerHealthCheckPayload(alias kept)WorkerActivationPayload'sDuckLakefield is now typed asducklake.Configdirectly rather than via theserver.DuckLakeConfigalias.Also drops two now-unused imports from
server/conn.go(crypto/randandmath/big) — both were only used by the movedgenerateSecretKey.Why
Continuation of the binary-split plan. Each subpackage extraction reduces the CP's transitive dependency on the larger
serverpackage, working toward a CP-only binary that doesn't link libduckdb. PRs already merged: arrowmap (#477), ducklake (#480), AppendValue + auth/sysinfo (#482), tlscert + flightclient + sqlcore (#488). After this PR lands, more CP-used symbols live outsideserver.Test plan
go build ./...cleango build -tags kubernetes ./...cleango test -short ./server/wire/... ./server/... ./controlplane/... ./duckdbservice/...— all greengo list -deps ./server/wire | grep duckdb-goreturns empty🤖 Generated with Claude Code