Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bot/prompts/engineer-followup/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Your job:
independent follow-up work in this PR.

Repo facts you need:
- Go 1.27.3 `database/sql` driver; `go build ./...` has warmed the module cache on
- The runner uses the Go version in `go.mod`. `go build ./...` has warmed the module cache on
the runner. This follow-up job wires **NO live-warehouse connection env**, so
only the pure-Go **`make test`** unit suite (CGO_ENABLED=0) runs here — do NOT
run or add the live e2e tests in `driver_e2e_test.go` (they need warehouse
Expand Down
2 changes: 1 addition & 1 deletion .bot/prompts/engineer-mention/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ the relevant source before editing. Never weaken tests or alter fixtures to
make a check pass. Keep public API and dependency changes out of scope unless
the maintainer explicitly requests them.

The runner provides Go 1.27.3 and a warmed module/tool cache. Verify Go edits with
The runner provides the Go version in `go.mod` and a warmed module/tool cache. Verify Go edits with
the affected `go test -run <TestName> ./<pkg>` tests, then `make test`,
`make lint`, and the read-only format check `gofmt -l -s .`. This job runs the
pure-Go driver with CGO_ENABLED=0 and GOPROXY=off. It has no live-warehouse
Expand Down
6 changes: 3 additions & 3 deletions .bot/prompts/engineer/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ prompt covers the repo-specific facts you need to follow it.

== THE REPO ==

A Go `database/sql` driver (module `github.com/databricks/databricks-sql-go`, Go
1.27.3). Source is the root package `dbsql` (`connection.go`, `connector.go`,
`driver.go`, `statement.go`, `result.go`, `parameters.go`, …) plus subpackages
A Go `database/sql` driver (module `github.com/databricks/databricks-sql-go/v2`).
The minimum Go version is declared in `go.mod`. Source is the root package `dbsql`
(`connection.go`, `connector.go`, `driver.go`, `statement.go`, `result.go`, `parameters.go`, …) plus subpackages
`auth/`, `rows/`, `errors/`, `logger/`, `driverctx/`, `telemetry/`, and
`internal/` (client, Thrift protocol, fetcher, etc.).

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/engineer-bot-followup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Set up Go Toolchain
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: '1.27.3'
go-version-file: go.mod
cache: false

- name: Build + warm caches (pure-Go; while JFrog creds are present)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/engineer-bot-mention.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Set up Go Toolchain
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: '1.27.3'
go-version-file: go.mod
cache: false

- name: Build and warm Go caches
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/engineer-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Set up Go Toolchain
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: '1.27.3'
go-version-file: go.mod
cache: false

- name: Build driver + warm caches (pure-Go; while JFrog creds are present)
Expand Down
33 changes: 23 additions & 10 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up Go Toolchain
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: '1.27.3'
go-version-file: go.mod
cache: false

- name: Lint
Expand All @@ -43,11 +43,16 @@ jobs:
version: 'v2.15.0'
install-mode: goinstall
build-and-test:
name: Test and Build
name: Test and Build (${{ matrix.lane }})
env:
GOTOOLCHAIN: local
strategy:
# Test the minimum patched toolchain and the latest 1.27 patch.
matrix:
go-version: ['1.27.3', '1.27.x']
matrix: &go-matrix
include:
- lane: min
go-version-file: go.mod
- lane: latest
go-version: '1.27.x'
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
Expand All @@ -60,9 +65,11 @@ jobs:
uses: ./.github/actions/setup-jfrog

- name: Set up Go Toolchain
id: setup-go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: ${{ matrix.go-version }}
go-version-file: ${{ matrix.go-version-file }}
check-latest: true
cache: false

Expand All @@ -72,9 +79,9 @@ jobs:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-

- name: Get dependencies
run: |
Expand Down Expand Up @@ -116,7 +123,11 @@ jobs:
CGO_ENABLED: 0

build-and-test-kernel:
name: Test (kernel backend)
name: Test (kernel backend, ${{ matrix.lane }})
strategy:
matrix: *go-matrix
env:
GOTOOLCHAIN: local
# Exercises the opt-in SEA-via-kernel backend: builds the Rust kernel static
# lib from the pinned KERNEL_REV and runs the `databricks_kernel`-tagged unit
# tests with CGO. Separate from build-and-test so that job's CGO_ENABLED=0
Expand All @@ -130,7 +141,7 @@ jobs:
# branch is pushed repeatedly (each push cancels the prior in-flight run).
timeout-minutes: 30
concurrency:
group: kernel-build-${{ github.workflow }}-${{ github.ref }}
group: kernel-build-${{ github.workflow }}-${{ github.ref }}-${{ matrix.lane }}
cancel-in-progress: true
runs-on:
group: databricks-protected-runner-group
Expand Down Expand Up @@ -175,7 +186,9 @@ jobs:
- name: Set up Go Toolchain
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: '1.27.3'
go-version: ${{ matrix.go-version }}
go-version-file: ${{ matrix.go-version-file }}
check-latest: true
cache: false

# Install the exact toolchain the kernel .a is built with. rust-toolchain.toml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Set up Go Toolchain
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: '1.27.3'
go-version-file: go.mod
cache: false

- name: Get dependencies
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
- name: Set up Go Toolchain
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: '1.27.3'
go-version-file: go.mod
cache: false

# Keep in lockstep with rust-toolchain.toml's channel (it governs the archive
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/securityScan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ jobs:
- name: Set up Go Toolchain
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
# Match the minimum patched toolchain declared in go.mod.
go-version: '1.27.3'
go-version-file: go.mod
cache: false

- name: Install osv-scanner
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Driver changes

- Lower the minimum supported Go version from 1.27.3 to 1.26.11. Go 1.27 users need 1.27.4 or newer for the emSign certificate distrust and November security fixes. The `go.mod` minimum accepts every Go 1.27 patch, including 1.27.0 through 1.27.3.
- Read buffered kernel result batches without a runtime hop, falling back to a blocking fetch when needed.
- Honor `WithPort` and the DSN port on the kernel backend, including after automatic Reyden recovery, instead of rejecting a non-default port. IPv6 hosts need brackets, and a port the kernel rejects returns an error wrapping both `ErrInvalidKernelConfig` and `ErrNotSupportedByKernel`.
- **Behavior change:** Nested `DATE` and `TIMESTAMP_NTZ` text changes in every session time zone, UTC included, with no option to restore the old text. This covers `ARRAY` elements, `MAP` values and keys, and `STRUCT` fields (databricks/databricks-sql-go#604).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ parameter, whether it applies to **Both**, **Thrift-only**, or **SEA-only**.

## Building

Requires Go 1.27.3 or newer.
Requires Go 1.26.11 or newer. On Go 1.27, use 1.27.4 or newer for the corresponding security fixes.

The two backends differ **at build time**, not just at connect.

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/databricks/databricks-sql-go/v2

go 1.27.3
go 1.26.11

tool gotest.tools/gotestsum

Expand Down
7 changes: 5 additions & 2 deletions internal/client/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ import (
)

func retryTestConfig(retries int) *config.Config {
return &config.Config{Authenticator: &noop.NoopAuth{}, RetryMax: retries}
return &config.Config{UserConfig: config.UserConfig{
Authenticator: &noop.NoopAuth{},
RetryMax: retries,
}}
}

func TestRetryStatusAndBodyReplay(t *testing.T) {
Expand Down Expand Up @@ -569,7 +572,7 @@ func TestRetryWithoutAuthenticator(t *testing.T) {
}
}))
defer server.Close()
httpClient := RetryableClient(&config.Config{RetryMax: 1})
httpClient := RetryableClient(&config.Config{UserConfig: config.UserConfig{RetryMax: 1}})
retry, ok := httpClient.Transport.(*retryTransport)
require.True(t, ok)
transport, ok := retry.client.Transport.(*http.Transport)
Expand Down
7 changes: 6 additions & 1 deletion internal/config/thrift_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ func TestThriftEndpointUnchanged(t *testing.T) {
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
c := &Config{Protocol: "https", Host: tc.host, Port: tc.port, HTTPPath: "/sql/1.0/warehouses/x"}
c := &Config{UserConfig: UserConfig{
Protocol: "https",
Host: tc.host,
Port: tc.port,
HTTPPath: "/sql/1.0/warehouses/x",
}}
got, err := c.ToEndpointURL()
if err != nil {
t.Fatalf("unexpected err %v", err)
Expand Down
10 changes: 6 additions & 4 deletions internal/featureflags/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ func TestFetchFeatureFlagsWithRetryableClient(t *testing.T) {
}))
defer server.Close()
httpClient := client.RetryableClient(&config.Config{
Authenticator: &noop.NoopAuth{},
RetryMax: 4,
RetryWaitMin: time.Millisecond,
RetryWaitMax: time.Millisecond,
UserConfig: config.UserConfig{
Authenticator: &noop.NoopAuth{},
RetryMax: 4,
RetryWaitMin: time.Millisecond,
RetryWaitMax: time.Millisecond,
},
})
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
Expand Down
Loading