Skip to content

Connecting Databases

Connect your relational and data warehouse databases to Querri for natural language querying and AI-powered analytics. Query production databases, data warehouses, and analytical stores without writing SQL.

Querri supports the following database systems:

  • PostgreSQL - Popular open-source relational database
  • MySQL - Widely-used open-source database
  • Microsoft SQL Server (MSSQL) - Enterprise relational database
  • BigQuery - Google Cloud data warehouse
  • Oracle Database - Enterprise relational database (development)
  • Snowflake - Cloud data warehouse (development)
  • Amazon Redshift - AWS data warehouse (development)

Each database type has its own connector configuration.

  1. Go to Settings → Connectors (/settings/connectors)
  2. Scroll to the Database category
  3. Click Connect on your database type

You’ll need to provide the following information:

Required fields:

  • Display Name: Custom name for this connection (e.g., “Production DB”)
  • Host: Database server address (e.g., db.example.com or localhost)
  • Port: Database port (default: PostgreSQL=5432, MySQL=3306, MSSQL=1433)
  • Database Name: Name of the database to connect to
  • Username: Database user with read permissions
  • Password: Database password

Optional fields:

  • SSL Mode: Enable SSL/TLS encryption (recommended for production)
  • Connection Timeout: Maximum time to wait for connection (default: 30s)

Example configuration:

Display Name: Customer Analytics DB
Host: analytics.mycompany.com
Port: 5432
Database: customer_data
Username: querri_readonly
Password: ••••••••••
SSL Mode: require

Required fields:

  • OAuth authentication (handled automatically through popup)
  • Project Selection: Choose your Google Cloud project
  • Dataset: Select the dataset to query
  • Table: Optionally select specific tables

Authentication process:

  1. Click “Connect” on BigQuery connector
  2. Sign in to your Google account
  3. Grant BigQuery permissions
  4. Select your project and dataset
  5. Connector is ready to use

Example:

Display Name: Analytics Warehouse
Project: my-company-analytics
Dataset: sales_data

Before saving, click Test Connection to verify:

  • Querri can reach the database server
  • Credentials are correct
  • The specified database exists
  • Network/firewall rules allow access

Connection test results:

  • Success: Connection established, connector ready to use
  • Failed: Review error message and adjust configuration

Common connection errors:

  • Connection refused: Check host, port, and firewall settings
  • Authentication failed: Verify username and password
  • Database does not exist: Confirm database name
  • SSL required: Enable SSL mode in configuration
  • Timeout: Check network connectivity or increase timeout

Once the test succeeds, click Save to activate the connector. It will now appear in your active connections and be available to the AI assistant.

For security, create a dedicated read-only user for Querri:

PostgreSQL:

CREATE USER querri_readonly WITH PASSWORD 'secure_password';
GRANT CONNECT ON DATABASE your_database TO querri_readonly;
GRANT USAGE ON SCHEMA public TO querri_readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO querri_readonly;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO querri_readonly;

MySQL:

CREATE USER 'querri_readonly'@'%' IDENTIFIED BY 'secure_password';
GRANT SELECT ON your_database.* TO 'querri_readonly'@'%';
FLUSH PRIVILEGES;

MSSQL:

CREATE LOGIN querri_readonly WITH PASSWORD = 'secure_password';
USE your_database;
CREATE USER querri_readonly FOR LOGIN querri_readonly;
ALTER ROLE db_datareader ADD MEMBER querri_readonly;
  • Passwords are encrypted at rest in Querri’s database
  • Use strong, unique passwords for database users
  • Consider using database service accounts with limited permissions
  • Rotate passwords periodically following your security policy

Querri’s database connectors have read-only access by design. The AI can:

Allowed operations:

  • SELECT queries to retrieve data
  • JOIN operations across tables
  • Aggregate functions (SUM, COUNT, AVG, etc.)
  • Filtering and sorting data
  • View table schemas and metadata

Restricted operations:

  • INSERT, UPDATE, DELETE statements
  • CREATE, ALTER, DROP commands
  • Transaction management
  • Stored procedure execution (unless explicitly read-only)
  • Administrative commands

This ensures the AI cannot modify your data, even inadvertently.

You can connect multiple instances of the same database type with different configurations:

Use cases:

  • Environment separation: Production, staging, development databases
  • Regional databases: Different databases per geographic region
  • Departmental databases: Sales, marketing, operations databases
  • Data warehouses: Separate OLTP and OLAP systems

Example setup:

PostgreSQL - Production Orders
PostgreSQL - Analytics Warehouse
PostgreSQL - Customer Support DB

When querying, specify which database to use:

“From the Production Orders database, show me today’s orders” “Compare revenue in Analytics Warehouse with Production Orders”

Once your database is connected, Querri automatically discovers your tables and schemas. Here’s how to start working with your data:

After connecting a database:

  1. Navigate to your Library in Querri
  2. You’ll see all accessible tables from your connected database(s)
  3. Each table appears as a data source you can work with
  4. Tables are automatically refreshed to show the latest schema

To analyze data from a database table:

  1. Go to your Library
  2. Find the table you want to analyze
  3. Click to Create Project from that table
  4. Start asking questions in natural language - Querri writes the SQL for you

Examples of what you can ask:

  • “Show me the top 10 customers by revenue”
  • “What’s the trend in sales over the last 6 months?”
  • “Find all orders from last week”
  • “Compare this month’s metrics to last month”

Querri handles all the SQL query writing automatically. You just ask questions naturally, and Querri translates them into optimized SQL queries against your database.

  • Index important columns: Ensure frequently queried columns are indexed
  • Limit result sets: Ask for specific data rather than full table dumps
  • Use date filters: Narrow queries to relevant time periods
  • Optimize views: Create database views for complex, repeated queries
  • IP whitelisting: HIGHLY RECOMMENDED - Whitelist Querri’s IP address (18.189.33.77) in your database firewall
  • Read-only access: Always use read-only database users
  • Least privilege: Grant access only to necessary tables/schemas
  • Network security: Use SSL/TLS for connections over public networks
  • Audit access: Monitor database logs for unusual query patterns
  • Credential encryption: All passwords are encrypted at rest
  • Connection pooling: Use connection limits appropriate for your database
  • Timeout settings: Configure reasonable timeouts for long-running queries
  • High availability: Connect to load-balanced or replicated database endpoints
  • Monitoring: Track query performance and connection health
  • Use replicas: Connect to read replicas instead of primary databases
  • Schedule queries: For large analytics, consider scheduling during off-peak hours
  • Archive old data: Keep tables small by archiving historical data
  • Document schema: Maintain documentation of table structures and relationships

Check:

  • Database server is running and accessible
  • Host and port are correct
  • Firewall allows connections from Querri
  • Database accepts connections from remote hosts
  • SSL/TLS settings match database requirements

Check:

  • Username and password are correct
  • User has CONNECT permission on the database
  • User account is not locked or expired
  • Password doesn’t contain special characters that need escaping

Optimize:

  • Add indexes to frequently filtered columns
  • Use specific column names instead of SELECT *
  • Filter data early in the query (WHERE clauses)
  • Avoid SELECT DISTINCT on large tables without indexes
  • Consider creating materialized views for complex aggregations

Check:

  • User has SELECT permission on tables
  • Tables exist in the correct schema/database
  • PostgreSQL: User has USAGE permission on schema
  • MSSQL: User has VIEW DEFINITION permission