Cookbook recipes to get up and running with Spice.ai quickly 🚀
Works with v1.0+
Deprecated: The SQLite acceleration engine is deprecated in Spice
v2.4and will be removed inv2.5. New Spicepods should use the default Cayenne (opens in a new tab) engine, and existing SQLite accelerations must move to Cayenne before upgrading tov2.5. See the migration guide (opens in a new tab).
Follow this recipe to configure dataset acceleration using SQLite.
Tip: Open and refer to the SQLite Data Accelerator (opens in a new tab) documentation while completing this recipe.
Tip: Follow the Advanced Data Refresh Recipe (opens in a new tab) to learn more about advanced data refresh scenarios, such as programmatically updating refresh_sql and triggering data refreshes.
Ensure the Spice CLI is installed. If not, follow the Spice Getting Started (opens in a new tab) guide to install.
Clone the Spice samples repository and navigate to the sqlite directory:
Start the Spice runtime
Output:
In a new terminal, start the Spice SQL REPL.
Enter a query to display the longest taxi trips:
Output:
Use a text editor to open spicepod.yaml and add the acceleration block shown below. Save.
Before:
After:
The following output is shown in the Spice runtime terminal confirming new configuration is applied.
Run query to display the longest taxi trips again:
Output:
Observe query execution time decreased from 2.1508365 to 0.193560667 seconds.