Skip to content

refactor(server): extract wire-level types into server/wire#489

Merged
fuziontech merged 1 commit intomainfrom
feature/server-wire
May 1, 2026
Merged

refactor(server): extract wire-level types into server/wire#489
fuziontech merged 1 commit intomainfrom
feature/server-wire

Conversation

@fuziontech
Copy link
Copy Markdown
Member

Summary

Carves the small CP↔worker RPC types and PG cancel-request helpers out of server/ into a new server/wire subpackage with zero duckdb-go dependency.

Symbols moved:

From To
server.BackendKey wire.BackendKey (alias kept in server)
server.GenerateSecretKey wire.GenerateSecretKey (re-export var kept)
server.WorkerControlMetadata wire.WorkerControlMetadata (alias kept)
server.WorkerActivationPayload wire.WorkerActivationPayload (alias kept)
server.WorkerCreateSessionPayload wire.WorkerCreateSessionPayload (alias kept)
server.WorkerDestroySessionPayload wire.WorkerDestroySessionPayload (alias kept)
server.WorkerHealthCheckPayload wire.WorkerHealthCheckPayload (alias kept)

WorkerActivationPayload's DuckLake field is now typed as ducklake.Config directly rather than via the server.DuckLakeConfig alias.

Also drops two now-unused imports from server/conn.go (crypto/rand and math/big) — both were only used by the moved generateSecretKey.

Why

Continuation of the binary-split plan. Each subpackage extraction reduces the CP's transitive dependency on the larger server package, 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 outside server.

Test plan

  • 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 returns empty

🤖 Generated with Claude Code

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>
@fuziontech fuziontech enabled auto-merge (squash) May 1, 2026 16:21
@fuziontech fuziontech merged commit e5b64df into main May 1, 2026
21 checks passed
@fuziontech fuziontech deleted the feature/server-wire branch May 1, 2026 16:24
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.

1 participant