Skip to content

Connecting Databases

Connect your databases and data warehouses to Querri, choose which tables to load, and ask questions about them in plain language.

Querri copies the tables you choose into its own storage and works from that copy, so answers don’t run against your database each time. Your data is as fresh as its last sync.

Snowflake and Databricks also offer Live tables: a table you mark Live stays in your warehouse, and each question runs as a query there instead. See Live Tables.

DatabaseHow it connectsPage
PostgreSQLHost and credentialsPostgreSQL
MySQL (and MariaDB)Host and credentialsMySQL
Microsoft SQL ServerHost and credentialsSQL Server
Amazon RedshiftHost and credentialsAmazon Redshift
BigQueryGoogle sign-inBigQuery
SnowflakeAccount identifier and key pair or token. Tables can be LiveSnowflake
DatabricksSQL warehouse and service principal or token. Tables can be LiveDatabricks
  • Click Connect in the app rail, then pick your database under Connect a data source.
  • Or, as an admin, open Settings → Connectors and click Connect on its card.

The connector dialog opens on its Configuration tab. The connector lands in the workspace you’re in if you’re a member, and in your private workspace otherwise.

PostgreSQL, MySQL, SQL Server and Redshift share one form. Snowflake and Databricks have their own fields, covered on their pages. Under Connection Settings:

FieldNotes
Connector NameDefaults to the database type. Use something descriptive, like “Orders replica”
Host *Host name (db.acme.com) or IP address
PortDefaults: 5432 PostgreSQL, 3306 MySQL, 1433 SQL Server, 5439 Redshift
Username *A read-only user is best (see below)
Password
DatabaseOptional. Leave it blank to discover databases from the server. Redshift fills in dev

Encryption:

  • PostgreSQL, MySQL and Redshift have a Require SSL Connection switch, on by default.
  • SQL Server has Trust Server Certificate (on by default) and Encrypt Connection (off by default).

Connect via VPN (Advanced): for a database reachable only through an OpenVPN tunnel. Turn it on and add all four files: OpenVPN config (.ovpn), CA certificate (ca.crt), Client certificate (.crt) and Client private key (.key).

Click Test connection and discover access.

On success you’ll see “Connected! Found {n} databases and {m} schemas”, and the button changes to Re-test connection. If it fails, Connection Failed appears with the reason.

Under Select Data:

  • Database & Schema: pick a database, then a schema (defaults to public, or dbo on SQL Server). Each schema shows how many tables it has. MySQL has no schema step. Choosing a database or schema saves the connector.
  • Table Selection: All Tables is on by default. Turn it off to pick tables yourself, with Select All, Clear and Filter tables….
  • Custom SQL Queries: click + Add Query to load the result of your own query as a source. Give it a Query Name and the SQL Query; Test Query runs it limited to 10 rows.

On Redshift, each table also has Advanced options for large tables (see Amazon Redshift).

Under Advanced Settings:

  • Limit rows per table: caps how many rows load from each table. MySQL starts with a limit of 100,000 rows; PostgreSQL, SQL Server and Redshift start unlimited.
  • Data Sync Enabled: whether tables sync from this database. It stays off until you load data.

Click Save and Load Data. Querri turns data sync on, saves, and runs a full sync. A progress card at the bottom of the screen shows each table as it loads, and stays there if you move to another page. When it’s done, it reads “{name} is ready”, with View in Library and a Sync daily button that sets up a daily full refresh.

To save changes without loading, click Update.

If the database or schema you picked is empty, Querri says no tables were found, so check your selection and try again.

BigQuery connects with Google sign-in instead of a host and password:

  1. Click Connect on BigQuery and sign in with Google.
  2. Under Select BigQuery Project, choose a project. There’s one connector per project.
  3. Choose tables, and add custom SQL queries if you need them (Test Query (LIMIT 10)).
  4. Limit total rows per table is on at 100,000 rows by default.

There’s no separate dataset step. See BigQuery.

These warehouses follow the same steps (connection settings, Test connection and discover access, Select Data, Save and Load Data) with their own fields:

  • Snowflake uses an account identifier, a role and a warehouse, and signs in with a key pair or a programmatic access token. Querri can generate the setup script for a read-only user. See Snowflake.
  • Databricks uses the SQL warehouse’s server hostname and HTTP path, and signs in with a service principal or a personal access token. You choose a catalog, then a schema. See Databricks.

In both, each selected table has a Live switch. Leave it off to copy the table into Querri, or turn it on to keep the table in the warehouse. See Live Tables.

Querri reads your data, and custom queries run whatever SQL you write, so connect with a dedicated read-only user. For Snowflake and Databricks, see their pages for a read-only role or service principal.

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;

SQL Server:

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;

Use strong, unique passwords, and grant access only to the schemas and tables people need. Database Best Practices shows how to set up an analytics schema.

If your database only accepts connections from known addresses, allow Querri’s outbound IP address in your firewall or security group. If it’s only reachable over a private network, use Connect via VPN (Advanced).

You can connect several databases of the same type, such as production, a reporting replica and a regional database. Each gets its own connector, settings and schedule. In Settings → Connectors, use the add-another icon on a connected card.

After loading, each table appears in the Library as a source typed Dataset. From there you can:

  • Ask the Librarian about it.
  • Open it to check its columns, row count and where it came from.
  • Select tables on the Files tab and click Create Project to start an analysis.

A connector’s owner can schedule syncs on the Schedule tab:

  • Full Refresh reloads every table.
  • Incremental fetches only new or changed rows, using a cursor column such as updated_at. Tables without that column are skipped by the incremental schedule. Leave the Cursor Field blank to let Querri detect one.

Good cursor columns:

  • updated_at or modified_at: catches new and changed rows
  • created_at, or an auto-incrementing id: only for tables that never update rows

On Snowflake and Databricks, the Schedule tab also has a Live tab, where you choose Live tables and how often their columns and row estimates refresh. Live tables are never copied, so syncs skip them.

Scheduled syncs use credits when they run; syncs you start by hand don’t. See Sync Scheduling.

  • Connect to a read replica rather than your primary database where you can.
  • Use a read-only user with access to only the tables people need.
  • Keep SSL on for connections over public networks.
  • Load only what you need, with Table Selection or Limit rows per table.
  • Create analytics views in your database for data that’s always joined together.

Connection Failed appears in the dialog. Check that:

  • the database is running and accepts remote connections
  • the host and port are right
  • your firewall or security group allows Querri’s address, or the VPN files are loaded
  • the SSL settings match what the server expects

Check that:

  • the username and password are right
  • the user has permission to connect to the database
  • the account isn’t locked or expired

Check that:

  • the user has SELECT on the tables
  • the tables are in the database and schema you picked
  • on PostgreSQL, the user has USAGE on the schema
  • on SQL Server, the user has VIEW DEFINITION permission

If Querri reports no tables found, the database or schema you picked is empty or the user can’t see its tables. Change the selection under Select Data and click Save and Load Data again.