refactor(server): drop duckdb.Interval from conn.go's formatValue / formatInterval#495
Merged
fuziontech merged 1 commit intomainfrom May 1, 2026
Merged
Conversation
…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>
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
Continues the PR #494 pattern.
server/conn.go'sformatValueused to switch onduckdb.Intervaldirectly, andformatIntervaltookduckdb.Intervalas parameter. Both required the duckdb-go driver to be imported in this file.This PR uses the existing
normalizeDriverValuehook (registered byduckdbservice'sinitin PR #494):formatValuecallsnormalizeDriverValue(v)at entry — driver-specific interval types convert toarrowmap.IntervalValuebefore the switchduckdb.Intervalcase is removed; onlyarrowmap.IntervalValueremainsformatInterval's signature is nowformatInterval(arrowmap.IntervalValue)server/conn_test.go'sTestFormatIntervaltable-test field wasduckdb.Interval— switched toarrowmap.IntervalValue(same layout:Months int32, Days int32, Micros int64) and dropped the now-unusedduckdbimport from the test file.What's left in conn.go
server/conn.gostill hasduckdb.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 ./...cleango build -tags kubernetes ./...cleango test -short -timeout 60s ./server/— green🤖 Generated with Claude Code