|
| 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 | + |
| 19 | + |
| 20 | +6. Click the "New" button on the right: |
| 21 | + |
| 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 | +  |
| 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 | +  |
| 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 | +  |
| 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 | +  |
| 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 | +  |
| 53 | + 1. Click the "Test Connection" button - your window should look like this: |
| 54 | +  |
| 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 | +  |
| 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 | +  |
| 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 | +  |
| 68 | + 1. You should see the query results as shown in this screenshot: |
| 69 | +  |
| 70 | + 1. You can now use DBeaver to query your Spice.ai datasets using SQL! 🎉 |
0 commit comments