PostgreSQL
Connecting Your Postgres Database to Sequel
Welcome to Sequel! This guide will help you connect your PostgreSQL database to Sequel, enabling you to run SQL queries using natural language and visualize results with charts and graphs.
Prerequisites
Before you begin, ensure you have the following:
- PostgreSQL Database: Make sure your PostgreSQL database is set up and running.
- Database Credentials: You will need the following details:
- Hostname or IP address
- Database name
- Username
- Password
- Port (default: 5432)
- 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 menu on the left-hand side.
- Click on Database Connections to open the database management page.
Step 2: Add a New Connection
- In the Databases section, click the New Connection button.
- From the list of available database types, select PostgreSQL.
Step 3: Enter Connection Details
You will now need to enter the required information to connect your PostgreSQL database:
- Display Name: Give your connection a meaningful name (e.g., "Production Database" or "Analytics DB").
- Host: Enter the hostname or IP address of your PostgreSQL database server.
- Port: The default port for PostgreSQL is
5432
. If your database uses a different port, specify that here. - Database Name: Enter the name of the PostgreSQL database you want to connect to.
- Username: Provide the PostgreSQL username with access to the database.
- Password: Enter the password for the PostgreSQL user.
Optionally, you may also configure SSL settings or provide additional connection parameters if required by your PostgreSQL setup.
Step 4: Test and Save the Connection
Click on test and save connection button to test the connection details and save the connection. After a successful test Sequel will open the explorer view for your connected database. You can now ask your database questions or execute SQL queries.
Step 5: Query Your Database
Now that your PostgreSQL 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 list of users added last month” or “What is the average order value?”.
- Sequel will convert your request into an SQL query, execute it against your PostgreSQL database, and display the results.
Step 6: Visualize Data with Charts and Graphs
Sequel also allows you to create visualizations simply by asking it to visualize the data as a bar chart, line chart or a pie chart.
eg:
- Show me the user growth in last 30 days in a line chart
- Show me a bar graph of my top selling products
- Show me a pie chart of top 10 organisations with most number of users
Troubleshooting
If you encounter any issues during the connection process:
- Connection Errors: Double-check your credentials and ensure your PostgreSQL database is reachable from the internet (or from within your local network if using a private instance).
- Firewall/Network Issues: Ensure that your PostgreSQL database server allows connections from Sequel's IP addresses or the IP address of your local machine (if using Sequel on-prem).
- SSL Configuration: If your PostgreSQL server requires SSL, make sure the proper SSL certificates and settings are provided during connection setup.
Conclusion
That’s it! You’ve successfully connected your PostgreSQL database to Sequel. Now you can leverage Sequel’s powerful natural language processing to query your database and generate insightful visualizations.
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 Postgres Database to Sequel
- Prerequisites
- Step 1: Navigate to Database Connections
- Step 2: Add a New Connection
- Step 3: Enter Connection Details
- Step 4: Test and Save the Connection
- Step 5: Query Your Database
- Step 6: Visualize Data with Charts and Graphs
- Troubleshooting
- Conclusion
- Additional Resources