MotherDuck
Connecting Your MotherDuck DuckDB Database to Sequel
Welcome to Sequel! This guide will help you connect your DuckDB database hosted with MotherDuck to Sequel, allowing you to run SQL queries using natural language and visualize results with charts and graphs.
Prerequisites
Before you begin, ensure you have the following:
- MotherDuck Account: Make sure your have signed up to MotherDuck.
- Database Credentials: You will need the following details:
- MotherDuck token (Goto settings -> General -> Create Token (set it to non-expiring))
- database (Name of the database in your account)
- Sequel Account: You must have a Sequel account. If you haven't signed up yet, you can create an account at Sequel.
Step 1: Navigate to Database Connections
- On the Sequel dashboard, locate the database section from left hand side.
- Click on Connect Database button to open the database management page.
Step 2: Add a New Connection
- In the Databases section, click the MotherDuck card.
Step 3: Enter Connection Details
You will now need to enter the required information to connect your DuckDB database:
- Display Name: Give your connection a meaningful name (e.g., "DuckDB Analytics" or "DuckDB OLAP DB").
- MotherDuck Token: Your MotherDuck token
- database: Name of your database
Creating your MotherDuck Token
To get your Mother token, Login to your MotherDuck account. and from the top left account options, click on settings.
From the general tab, select Create Token.
Give a name for the token as "Sequel", and make sure "Automatically expire this token" is deselected
Step 4: Test and Save the Connection
Click on the "Test and Connection" button (if available) to validate the connection details. If the test is successful, the connection will be automatically saved.
Step 5: Query Your Database
Now that your DuckDB database is connected, you can start querying it using natural language:
- Return to the Sequel dashboard.
- In the query input box, type a question or request, such as "Show me the top 10 most frequent events in the last 24 hours" or "What is the average query execution time?".
- Sequel will convert your request into a DuckDB SQL query, execute it against your database, and display the results.
Step 6: Visualize Data with Charts and Graphs
Sequel allows you to create visualizations based on your query results. You can request specific types of charts or graphs in natural language.
For example:
- "Show me the event count trend over the last 30 days in a line chart."
- "Display a bar graph of the top 10 slowest queries."
- "Create a pie chart of the distribution of query types in the last hour."
Troubleshooting
If you encounter issues during the connection process:
-
Connection Errors:
- Verify your credentials and ensure your DuckDB server is reachable from Sequel's network.
- Check if you need to whitelist Sequel's IP addresses in your firewall settings.
-
Authentication Problems:
- Confirm that the user has the necessary permissions to access the specified database and execute queries.
- If using non-default authentication methods, ensure they're properly configured.
-
Performance Concerns:
- Avoid querying large datasets as Sequel is web based.
- Optimize your DuckDB settings for your specific use case and hardware.
Conclusion
You've now connected your DuckDB database to Sequel. You can leverage Sequel's natural language processing to query your DuckDB database and generate insightful visualizations.
For optimal performance and security, always follow DuckDB's best practices and keep your database and connection methods up to date.
If you have any further questions or need additional help, feel free to reach out to our support team or consult the Sequel documentation.
Happy querying!
Additional Resources
On this page
- Connecting Your MotherDuck DuckDB Database to Sequel
- Prerequisites
- Step 1: Navigate to Database Connections
- Step 2: Add a New Connection
- Step 3: Enter Connection Details
- Creating your MotherDuck Token
- Step 4: Test and Save the Connection
- Step 5: Query Your Database
- Step 6: Visualize Data with Charts and Graphs
- Troubleshooting
- Conclusion
- Additional Resources