Go SDK 0.9.0

Released .

Go SDK 0.9.0 follows 0.8.0 and 0.7.1 with server-assigned statement identifiers, typed regular-expression search index analyzers in Catalog definitions, and strict HTTP status validation on statement endpoints. Go 1.27.3 or later is required. For a new application, start with the Go SDK guide.

What's new

  • Configure custom regular-expression search analyzers on Catalog columns with *CatalogSearchAnalyzer, or leave Analyzer nil to use the server's default tokenization pattern.
  • Use server-assigned statement IDs returned on StatementHandle.ID() and retained on post-submission errors (Error.StatementID) while limiting automatic retry eligibility on submission to validated HTTP 429 admission refusals.
  • Require HTTP 200 or 202 on statement submission and HTTP 200 on statement refresh and cancellation.
  • From 0.8.0: guard Catalog mutations with Version and ExpectedVersion, inspect Error.CatalogOutcome and AppendOutcome, and reuse decoded statement rows and compression buffers across requests.

Upgrade from 0.8 and 0.7

Upgrade to Go 1.27.3 or later, update the module dependency, and commit go.mod and go.sum:

go get github.com/scopedb/goscopedb@v0.9.0

Applications upgrading from 0.8.0 only need the 0.9 statement and analyzer updates below. Applications upgrading directly from 0.7.0 or 0.7.1 should also apply the Catalog, Append, and statement error updates introduced in 0.8.0. Applications using 0.6 should first follow Upgrade from 0.6.

Update statement identifiers and deadlines

ScopeDB assigns each statement ID when accepting a submission and no longer accepts caller-supplied statement IDs or estimated duration limits:

In 0.7 or 0.8In 0.9
statement.ID = new(id)Removed; read handle.ID() after Submit succeeds
statement.MaxEstimatedRemoved in 0.8; use statement.MaxElapsed when a total deadline is intended
Error.StatementID when Submit failsnil; reconcile side effects unless Error.Retryable is true
Old StatementErrorCode* constants (0.7)StatementErrorCodeBadRequest, StatementErrorCodeTimeout, and StatementErrorCodeInternalServerError

If Statement.Submit (or the submission step of Statement.Execute or Client.Query) fails before receiving a valid status snapshot, Error.StatementID is nil. Only validated HTTP 429 admission refusals report Error.Retryable == true; transport failures, timeouts, and HTTP 5xx responses leave acceptance uncertain. Once submission succeeds, handle.ID() and post-submission failures retain the server-assigned StatementID so you can resume waiting with client.StatementHandle(*apiError.StatementID).

Update Catalog search index analyzers

CatalogColumnIndex.Analyzer changes from string to *CatalogSearchAnalyzer:

In 0.8In 0.9
Analyzer: "" or Analyzer: "log"Analyzer: nil (omitted when marshaling Apply requests)
Raw JSON workarounds for custom regex rulesAnalyzer: &scopedb.CatalogSearchAnalyzer{Patterns: []string{...}}

Leave Analyzer nil for the server's default tokenization pattern, or set Patterns for custom regular-expression rules:

customSearch := scopedb.CatalogColumnIndex{
	Type: "search",
	Analyzer: &scopedb.CatalogSearchAnalyzer{
		Patterns: []string{`[A-Za-z0-9_]+`, `req-[0-9]+`},
	},
}

Typed Catalog reads normalize omitted analyzer, null, {}, and legacy "log" values to nil.

Rename Catalog versions and Append outcomes (from 0.7)

If you are upgrading directly from 0.7.0 or 0.7.1, update these Catalog and Append identifiers as well:

In 0.7In 0.8 and 0.9
CatalogSnapshot.ETag / Result.ETagVersion
CatalogOptions.IfMatchExpectedVersion
Checking catalog_commit_outcome_unknownError.CatalogOutcome (CatalogMutationRejected or CatalogMutationUnknown)
AppendState (Committed, Rejected, Unknown)AppendOutcome (AppendOutcomeSucceeded, AppendOutcomeFailed, AppendOutcomeAmbiguous)
RetryUnknownRetryAmbiguous
UnknownRows / UnknownBatchesAmbiguousRows / AmbiguousBatches
AppendDeliveryOK / AppendDeliveryUnknownAppendDeliverySucceeded / AppendDeliveryAmbiguous

AppendOutcome retains the JSON/string spellings "committed", "rejected", and "unknown", while delivery outcome strings become "succeeded" and "ambiguous". Streams retry remote Append failures automatically only for validated HTTP 429 admission refusals; client timeouts with ambiguous outcomes are never replayed automatically.