Skip to content

refactor(server): drop duckdb.Interval from conn.go's formatValue / formatInterval#495

Merged
fuziontech merged 1 commit intomainfrom
feature/conn-format-normalize
May 1, 2026
Merged

refactor(server): drop duckdb.Interval from conn.go's formatValue / formatInterval#495
fuziontech merged 1 commit intomainfrom
feature/conn-format-normalize

Conversation

@fuziontech
Copy link
Copy Markdown
Member

Summary

Continues the PR #494 pattern. server/conn.go's formatValue used to switch on duckdb.Interval directly, and formatInterval took duckdb.Interval as parameter. Both required the duckdb-go driver to be imported in this file.

This PR uses the existing normalizeDriverValue hook (registered by duckdbservice's init in PR #494):

  • formatValue calls normalizeDriverValue(v) at entry — driver-specific interval types convert to arrowmap.IntervalValue before the switch
  • The duckdb.Interval case is removed; only arrowmap.IntervalValue remains
  • formatInterval's signature is now formatInterval(arrowmap.IntervalValue)

server/conn_test.go's TestFormatInterval table-test field was duckdb.Interval — switched to arrowmap.IntervalValue (same layout: Months int32, Days int32, Micros int64) and dropped the now-unused duckdb import from the test file.

What's left in conn.go

server/conn.go still has duckdb.Appender / duckdb.NewAppenderFromConn (four lines for COPY support). Handling that needs a build-tag or separate file split — deferred to a follow-up. After this PR, conn.go's duckdb-go usage is reduced to just the COPY codepath (4 lines + 1 comment).

Test plan

  • go build ./... clean
  • go build -tags kubernetes ./... clean
  • go test -short -timeout 60s ./server/ — green

🤖 Generated with Claude Code

…ormatInterval

Continues the PR #494 pattern. server/conn.go's formatValue used to
switch on duckdb.Interval directly; formatInterval took duckdb.Interval
as parameter. Both required the duckdb-go driver in this file.

Replaces with the existing normalizeDriverValue hook (registered by
duckdbservice's init in PR #494):

  - formatValue calls normalizeDriverValue(v) at entry — driver-specific
    interval types convert to arrowmap.IntervalValue before the switch
  - The duckdb.Interval case is removed; only arrowmap.IntervalValue
    remains
  - formatInterval's signature is now formatInterval(arrowmap.IntervalValue)

server/conn_test.go's TestFormatInterval table-test field was
duckdb.Interval — switched to arrowmap.IntervalValue (same field
layout: Months int32, Days int32, Micros int64) and dropped the now-
unused `duckdb` import from the test file.

server/conn.go still has duckdb.Appender / duckdb.NewAppenderFromConn
(four lines for COPY support) — handling that needs a build-tag or
separate file split, deferred to a follow-up. After this PR conn.go's
duckdb-go usage is reduced to just the COPY codepath.

Verified:
  - go build ./... clean
  - go build -tags kubernetes ./... clean
  - go test -short -timeout 60s ./server/ — green

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@fuziontech fuziontech enabled auto-merge (squash) May 1, 2026 17:48
@fuziontech fuziontech merged commit f09aa5b into main May 1, 2026
20 of 21 checks passed
@fuziontech fuziontech deleted the feature/conn-format-normalize branch May 1, 2026 17:52
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