Documentation Index
Fetch the complete documentation index at: https://docs.textql.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This guide walks you through connecting TextQL to your PostgreSQL database. You’ll need connection credentials from your PostgreSQL account to complete the setup.Prerequisites
To connect TextQL with your PostgreSQL database, you will need:- Host URL and Port (default: 5432)
- Username and Password
- Database name (default: postgres)
- Schemas (optional, if you want to specify specific schemas)
Finding Your Connection Details
Connection String Format
Most PostgreSQL providers display the connection string in this format:Example Connection String Breakdown
- Host URL:
db.example.com - Port:
5432 - Username:
username - Password:
pass123 - Database:
mydb
Creating the Connector in TextQL
Step 1: Navigate to Connectors Page
- Go to the TextQL Connectors Page
- Click New Connector
Step 2: Select PostgreSQL
Select Postgres from the available connectors to open the configuration form.Step 3: Enter Connection Details
The form requires the following information:| Field | Description | Example |
|---|---|---|
| Connector Name | A descriptive name to identify this connection | My PostgreSQL Database |
| Host URL | The endpoint URL of your PostgreSQL database | db.example.com |
| Port | The port number for your connection | 5432 |
| Username | Your PostgreSQL username | postgres |
| Password | Your database password | •••••••• |
| Database | The name of the database to connect to | postgres |
| Schemas | (Optional) Specific schemas to include | public, analytics |
Step 4: Test and Create
- Click Test Connection to verify your credentials and network access
- Once the test succeeds, click Create Connector to save the connection
Connecting via SSH Tunnel
If your PostgreSQL database is in a private subnet and not directly reachable from the internet, you can connect through an SSH tunnel (also called a bastion host or jump server). TextQL will open an encrypted SSH connection to your bastion host and forward database traffic through it.When to Use an SSH Tunnel
- Your database is in a private VPC with no public endpoint
- Your security policy requires all external access to go through a bastion host
- You cannot or prefer not to whitelist TextQL’s IP addresses directly on the database
SSH Tunnel Prerequisites
In addition to your standard database credentials, you will need:| Field | Description | Example |
|---|---|---|
| SSH Host | The hostname or IP of your bastion server | bastion.example.com |
| SSH Port | The SSH port on the bastion (default: 22) | 22 |
| SSH Username | The OS-level user on the bastion | ec2-user |
| SSH Private Key | A PEM-formatted private key authorized on the bastion | -----BEGIN OPENSSH PRIVATE KEY----- |
| SSH Host Public Key | (Optional) The bastion’s public host key for verification | ssh-ed25519 AAAA... |
Setting Up the SSH Tunnel
- In the PostgreSQL connector form, check Connect via SSH tunnel (bastion host)
- The SSH configuration fields will appear below the standard connection fields
- Enter your bastion host, port, username, and private key
- For Host URL and Port in the main connection fields, enter the database’s private address (the address reachable from the bastion host, not from the public internet)
How It Works
When TextQL connects to your database through an SSH tunnel:- TextQL establishes an encrypted SSH connection to your bastion host
- A secure tunnel is created from TextQL through the bastion to your database’s private address
- All database queries are forwarded through this tunnel
- The tunnel is torn down after the session ends
SSH Tunnel Troubleshooting
“Failed to establish SSH tunnel”- Verify the bastion host is reachable from the internet on the specified SSH port
- Confirm the SSH username and private key are correct
- Ensure the private key is in PEM format (starts with
-----BEGIN) - Check that the bastion’s security group allows inbound SSH from TextQL’s IPs (
44.229.62.69and54.69.138.147)
- The SSH tunnel connected, but the database is not reachable from the bastion. Verify:
- The database host and port are correct (use the private address)
- The bastion host has network access to the database
- Database security groups allow inbound connections from the bastion
- The SSH Host Public Key you provided does not match the bastion server’s actual host key. Retrieve the correct key from the bastion and update the connector.
Troubleshooting
Connection Fails
Verify the following:- Connection credentials are correct
- Host URL and port are accurate
- Database name is spelled correctly
- PostgreSQL server is running and accessible
Having trouble connecting? See the Network Configuration Guide for firewall and IP whitelisting setup.
Authentication Errors
Check:- Username and password are correct
- User has appropriate permissions
- Password doesn’t contain special characters that need escaping
Timeout Errors
Possible causes:- Firewall blocking connection
- Incorrect host URL or port
- Database server not responding
- Network connectivity issues
What’s Next
Once your PostgreSQL connector is set up, you can:- Ask Ana natural language questions about your data
- Generate SQL queries and visualizations
- Create reports and dashboards
- Share insights with your team