Package ai.spice
Class SpiceClient
java.lang.Object
ai.spice.SpiceClient
- All Implemented Interfaces:
AutoCloseable
Client to execute SQL queries against Spice.ai Cloud and Spice.ai OSS
-
Constructor Summary
ConstructorsConstructorDescriptionSpiceClient(String appId, String apiKey, URI flightAddress, URI httpAddress, int maxRetries) Constructs a new SpiceClient instance with the specified parameters -
Method Summary
-
Constructor Details
-
SpiceClient
Constructs a new SpiceClient instance with the specified parameters- Parameters:
appId- the application ID used to identify the client applicationapiKey- the API key used for authentication with Spice.ai servicesflightAddress- the URI of the flight address for connecting to Spice.ai serviceshttpAddress- the URI of the Spice.ai runtime HTTP addressmaxRetries- the maximum number of connection retries for the client
-
-
Method Details
-
builder
Returns a new instance of SpiceClientBuilder- Returns:
- A new SpiceClientBuilder instance
- Throws:
URISyntaxException- if there is an error in constructing the URI
-
query
Executes a sql query- Parameters:
sql- the SQL query to execute- Returns:
- a FlightStream with the query results
- Throws:
ExecutionException- if there is an error executing the query
-
refresh
- Throws:
ExecutionException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-