You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/go.yml
+76-72Lines changed: 76 additions & 72 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ jobs:
16
16
fail-fast: false
17
17
matrix:
18
18
os: [ubuntu-latest, macos-latest, windows-latest]
19
-
go-version: ['1.24', '1.25']
19
+
go-version: ['1.25', '1.26']
20
20
steps:
21
21
- uses: actions/checkout@v5
22
22
@@ -31,11 +31,18 @@ jobs:
31
31
- name: golangci-lint
32
32
uses: golangci/golangci-lint-action@v8
33
33
with:
34
-
version: v2.1
34
+
version: v2.12
35
35
36
36
- name: Build
37
37
run: go build -v ./...
38
38
39
+
# The Spice runtime cannot be installed or run natively on Windows, so the
40
+
# Windows job runs the runtime-free unit tests natively and defers the
41
+
# runtime install + integration tests to WSL (see the WSL steps below).
42
+
- name: Unit tests (Windows native)
43
+
if: matrix.os == 'windows-latest'
44
+
run: go test -v -run 'TestUserAgent|TestPrependedUserAgent|TestInferArrowType|TestAppendValueToBuilder|TestComprehensiveArrowTypes|TestParamType|TestTypedParamInference|TestExtendedArrowTypes' ./...
gospice v8 supports parameterized queries using ADBC (Arrow Database Connectivity), which is the recommended approach for queries with parameters to prevent SQL injection:
63
+
gospice v9 supports parameterized queries using ADBC (Arrow Database Connectivity), which is the recommended approach for queries with parameters to prevent SQL injection:
64
64
65
65
```go
66
66
// Query with a single parameter
@@ -110,7 +110,7 @@ defer reader.Release()
110
110
For precise control over Arrow types, use typed parameter constructors:
111
111
112
112
```go
113
-
import"github.com/spiceai/gospice/v8"
113
+
import"github.com/spiceai/gospice/v9"
114
114
115
115
// Explicit type control for complex scenarios
116
116
reader, err:= spice.SqlWithParams(
@@ -161,9 +161,54 @@ if err := spice.Init(
161
161
}
162
162
```
163
163
164
+
## Async Queries
165
+
166
+
`Query` and `QueryWithParams` submit SQL for **asynchronous** execution and return an `*AsyncQuery` handle. Async queries run in the background on the Spice runtime and are designed for long-running analytical and batch workloads. They require the runtime to be running in distributed/scheduler mode (`spiced --role scheduler` with `runtime.scheduler.state_location` configured).
167
+
168
+
```go
169
+
// Submit a query for async execution
170
+
query, err:= spice.Query(context.Background(), "SELECT * FROM taxi_trips")
"SELECT * FROM taxi_trips WHERE trip_distance > $1 LIMIT $2",
194
+
5.0,
195
+
100,
196
+
)
197
+
```
198
+
199
+
The `*AsyncQuery` handle provides:
200
+
201
+
-`ID()` - the server-assigned query ID
202
+
-`Status(ctx)` - poll the current status once (`PENDING`, `RUNNING`, `SUCCEEDED`, `FAILED`, `CANCELLED`, `CLOSED`)
203
+
-`Wait(ctx)` - block until the query reaches a terminal status
204
+
-`Results(ctx)` - wait for completion and return results as an `array.RecordReader`
205
+
-`Cancel(ctx)` - request cancellation
206
+
207
+
For synchronous, real-time streaming queries, use `Sql` / `SqlWithParams` instead.
208
+
164
209
## Health Checks
165
210
166
-
gospice v8 provides health check methods to verify Spice instance status before executing queries:
211
+
gospice v9 provides health check methods to verify Spice instance status before executing queries:
167
212
168
213
```go
169
214
// Check if Spice instance is healthy (unauthenticated)
@@ -202,32 +247,32 @@ spice.SetMaxRetries(5) // Setting to 0 will disable retries
202
247
Retries are performed for connection and system internal errors. It is the SDK user's responsibility to properly
203
248
handle other errors, for example RESOURCE_EXHAUSTED (HTTP 429).
204
249
205
-
## Upgrading from v7 to v8
250
+
## Upgrading from v8 to v9
206
251
207
-
gospice v8 is fully backward compatible with v7. To upgrade:
252
+
gospice v9 is a new major version with breaking changes. To upgrade:
208
253
209
254
```bash
210
-
go get github.com/spiceai/gospice/v8@latest
255
+
go get github.com/spiceai/gospice/v9@latest
211
256
go mod tidy
212
257
```
213
258
214
259
Update your imports:
215
260
216
261
```go
217
262
// Before
218
-
import"github.com/spiceai/gospice/v7"
263
+
import"github.com/spiceai/gospice/v8"
219
264
220
265
// After
221
-
import"github.com/spiceai/gospice/v8"
266
+
import"github.com/spiceai/gospice/v9"
222
267
```
223
268
224
-
**What's new in v8:**
269
+
**Breaking changes in v9:**
225
270
226
-
-New `Sql()` and `SqlWithParams()`methods for cleaner API (`.Query()` methods still work for backward compatibility)
227
-
-`IsSpiceHealthy()` and `IsSpiceReady()` health check methods
228
-
- Apache Arrow v18 and Go 1.24 support
271
+
-`Query()` and `QueryWithParams()`are now **asynchronous** and return an `*AsyncQuery` handle instead of an `array.RecordReader`. Use the handle's `Wait()`/ `Results()`methods (see [Async Queries](#async-queries)), or switch to the synchronous `Sql()` / `SqlWithParams()` methods.
272
+
-Minimum Go version is now **1.25** (was 1.24).
273
+
-Upgraded to Apache Arrow v18.6.0 and ADBC v1.11.0, matching the Spice.ai runtime's DataFusion 54.
229
274
230
-
See [UPGRADE_V7_TO_V8.md](UPGRADE_V7_TO_V8.md) for detailed migration guide.
275
+
See [UPGRADE_V8_TO_V9.md](UPGRADE_V8_TO_V9.md) for the detailed migration guide.
0 commit comments