Skip to content

Commit 5c23b84

Browse files
Add Flight SQL documentation
1 parent 8b1771a commit 5c23b84

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
type: docs
3+
title: "DBeaver"
4+
linkTitle: "DBeaver"
5+
description: 'Configure DBeaver to query Spice.ai via JDBC'
6+
weight: 60
7+
---
8+
9+
1. Start the Spice.ai runtime with a dataset loaded. Follow the [quickstart guide]({{<ref "getting-started">}}) to get started.
10+
11+
2. Download [DBeaver Community Edition](https://dbeaver.io) if you haven't already.
12+
13+
3. Download the [Apache Arrow Flight SQL JDBC driver](https://search.maven.org/search?q=a:flight-sql-jdbc-driver) - choose the "jar" option.
14+
15+
4. Launch DBeaver
16+
17+
5. In the DBeaver application menu bar, open the "Database" menu and choose: "Driver Manager":
18+
![Driver manager menu option](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/691d1f83-c1d0-4ad8-ec8d-d8f37ccc9d00/public "Driver manager menu option")
19+
20+
6. Click the "New" button on the right:
21+
![Driver manager new button](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/5783d944-daae-4735-99e9-976f974bc100/public "Driver manager new button")
22+
23+
24+
7. Add the JDBC jar file:
25+
1. Click the "Libraries" tab
26+
1. Click the: "Add File" button
27+
1. Choose the "flight-sql-jdbc-driver-11.0.0.jar" jar file (the file downloaded in step 3 above) - and click "Open"
28+
![Select jar file](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/19900f7a-f00f-473d-780e-4a28c2ecd800/public "Select jar file")
29+
1. Close the Driver editor window with the blue "OK" button on the lower-right
30+
31+
32+
8. Enter the driver settings:
33+
1. Click the "Settings" tab
34+
1. In the "Driver Name" field - enter: ```Apache Arrow Flight SQL```
35+
1. In the "URL Template" field - enter: ```jdbc:arrow-flight-sql://{host}:{port}?useEncryption=false&disableCertificateVerification=true```
36+
1. In the "Driver Type" drop-down box - choose: "SQLite"
37+
1. Select "No authentication"
38+
1. Your driver manager "Edit Driver" window should look like this:
39+
![Driver Manager completed](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/20348c42-117b-4763-80d2-6e615b23ae00/public "Driver Manager completed")
40+
1. Click the blue "OK" button on the lower-right to save the driver
41+
1. Close the "Driver Manager" window by clicking the blue "Close" button on the lower-right.
42+
43+
44+
9. Create a new Database Connection:
45+
1. In the DBeaver application menu bar, open the "Database" menu and choose: "New Database Connection":
46+
![New Database Connection](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/acdf7251-4238-44ee-9639-0c557518da00/public "New Database Connection")
47+
1. In the "Connect to a database" window - type: ```Flight``` in the search bar
48+
1. Choose the ```Apache Arrow Flight SQL``` driver - your window should look like this:
49+
![Connect to a database window](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/61cee5fe-dc75-4ac1-e558-eea3aff4c100/public "Connect to a database window")
50+
1. Click the blue "Next >" button on the bottom of the window
51+
1. On the next screen, the JDBC URL should be filled out already - just supply the Host (`localhost`) and Port (`50051`) values for your Spice.ai runtime. Your window should look like this:
52+
![Connect to a database window 2](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/2a2b2fdc-00db-49d3-5359-059b12342b00/public "Connect to a database window 2")
53+
1. Click the "Test Connection" button - your window should look like this:
54+
![Test Connection results](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/a3fc5f5f-a39f-47ce-7955-4b384ec1ae00/public "Test Connection results")
55+
1. Click the blue "OK" button to close the Connection test window
56+
1. Click the "Connection details (name, type, ...)" button on the right
57+
1. In the "General" section, enter: `Spice.ai Runtime` for the "Connection name". It should look like this:
58+
![Name the Database Connection](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/f6d04fe1-92a1-4082-d4ea-e9daacaca200/public)
59+
1. Click the blue "Finish" button to save the connection
60+
61+
62+
10. Run a query:
63+
1. Right-click on the Database Connection on the left - choose: "SQL Editor", and then: "Open SQL Console" as shown here:
64+
![Open SQL Console](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/642a5885-9e3f-4dd7-ef43-72bfce27bb00/public "Open SQL Console")
65+
1. In the Console window - run a query - something like: ```SELECT * FROM taxi_trips;```
66+
1. Click the triangle button to execute the SQL statement - as shown below (or use keyboard shortcut: Ctrl+Enter):
67+
![Execute SQL](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/2134e47b-a066-47e9-1d48-06352675f400/public "Execute SQL")
68+
1. You should see the query results as shown in this screenshot:
69+
![Query Results](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/0e9f3c0f-2e03-47f9-8d5e-65e078d7e900/public "Query Results")
70+
1. You can now use DBeaver to query your Spice.ai datasets using SQL! 🎉
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
type: docs
3+
title: "Arrow Flight SQL"
4+
linkTitle: "Arrow Flight SQL"
5+
weight: 30
6+
description: "Query against Spice.ai using JDBC/ODBC/ADBC"
7+
---
8+
9+
Arrow Flight SQL is a protocol for interacting with SQL databases using the Arrow in-memory format and the Flight RPC framework. Spice.ai implements the Flight SQL protocol which enables querying against the datasets configured in Spice.ai via your favorite SQL and BI tools.
10+
11+
<img src="https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/0a8bc474-03c3-4c1c-8003-d250cd52b300/public">
12+

0 commit comments

Comments
 (0)