Go SDK
Golang SDK for Spice.ai
Last updated
Was this helpful?
Golang SDK for Spice.ai
Last updated
Was this helpful?
The gospice
is the easiest way to query from Go.
It uses to efficiently stream data to the client and Records as data frames.
GoDocs are available at:
(or later)
Get the gospice package.
1. Import the package.
2. Create a SpiceClient
by providing your API key. Get your free API key at .
3. Initialize the SpiceClient
.
5. Iterate through the reader to access the records.
Or using custom flight address:
Run go run .
to execute a sample query and print the results to the console.
The SpiceClient
implements connection retry mechanism (3 attempts by default). The number of attempts can be configured via SetMaxRetries
:
Retries are performed for connection and system internal errors. It is the SDK user's responsibility to properly handle other errors, for example RESOURCE_EXHAUSTED (HTTP 429)
.
4. Execute a query and get back an .
Follow the to install and run spice locally.
Check to learn more.
Contribute to or file an issue with the gospice
library at: