Skip to content
GenerateDocs
What's new
ConnectorsDatabases
On this page

Connect a database so Generate can query it

Add a SQL, MongoDB or Neo4j database to a chat, agent or project, choose the tables it may read, keep its schema in sync and fix connection errors.

EditionsEnterprise: availableConsumer: availableStorage: availableHealthcare: availableAirgapped: available in partno cloud warehouses
Who can do thisAnyone whose team grants the Add database privilege, which teams hold by default.
WhereA chat's Add files and more button, then Add database.

This page shows you how to connect a database so that Generate answers questions from its tables, collections or graph.

Connect a database to a chat, an agent or a project and choose what it may read.

  1. Open Add database

    In a chat, select Add files and more in the chat box, then Add database. In an agent or a project, open its knowledge section and the Databases tab.

  2. Pick the engine

    The Add database window opens on Select type. Under Select database type, pick the engine, then select Continue.

    The Add database window on its Select type step, with the eleven engines as tiles and ContinueOpen full size
    Shown in the enterprise edition.
  3. Enter the connection details

    On Connect, enter the details for that engine, listed in Connection details by engine. Select Test connection; “Connection successful!” means Generate reached the database with those credentials.

    The Connect step for PostgreSQL, with the connection fields and Database port set to 5432Open full size
    Shown in the enterprise edition.
  4. Select Continue

    Or select Back to change the engine.

  5. Choose the tables

    On Select tables, tick the tables the agent may query, or Select all. Each table shows how many columns it has; search the list to find a table, and use Refresh if you just created one.

  6. Select Add database

    “Database created successfully!” confirms it.

For MongoDB the last step is Select collections, and the fields of each collection are inferred from a sample of its documents. For Neo4j it is Select node labels, and relationship types are read from the graph’s schema.

Keep a database’s tables in step with the live database, or change how Generate reaches it.

  1. Select Edit

    Open the database’s menu and select Edit. The Edit database window opens.

  2. Sync the tables

    On Tables, which lists the tables in use, select Sync to compare with the live database. New tables are added and marked NEW, and tables that no longer exist are removed and named.

  3. Check the other tabs

    Configuration holds the connection details you entered, and Summary describes what the database contains.

Select Delete in the same menu to remove the database. When processing a database fails, its row shows an error mark; hover over it for the reason, then select Retry processing beside it to queue the database again.

Engine What Generate asks for
MySQL, PostgreSQL, Redshift, ClickHouse Database host, Database port, Database name, Username, Password, and an optional SSL CA certificate
MariaDB The same fields as MySQL
Oracle DB Database host, Database port, Service name or SID (alternative), Schema, Username, Password
Snowflake Account, Warehouse, Database name, Schema, Username, Password
BigQuery Project ID, Dataset ID, and a Service account key (JSON) file
AWS Athena AWS region, AWS access key ID, AWS secret access key, Database name
MongoDB A Connection string, or Host and port with Username, Password, Auth source, Replica set and Use TLS/SSL; then Database name and optional Permitted collections
Neo4j Connection URI, Username, Password, optional Database and Permitted node labels

Leave Database port empty to use the engine’s own default: 3306 for MySQL and MariaDB, 5432 for PostgreSQL, 5439 for Redshift, 1521 for Oracle, 8123 for ClickHouse, 27017 for MongoDB and 7687 for Neo4j. Snowflake’s Warehouse must be running when you connect.

A few fields need care:

  • SSL CA certificate is required by cloud-hosted instances that enforce TLS, such as AWS RDS, Google Cloud SQL, Azure or IBM Cloud. Paste the PEM text, from -----BEGIN CERTIFICATE----- to -----END CERTIFICATE-----.
  • For ClickHouse, turn on Use TLS/SSL when the server answers over HTTPS, as ClickHouse Cloud does on port 8443.
  • For MongoDB Atlas, paste the mongodb+srv:// connection string. It turns on TLS and finds every replica set member by itself. Name the database anyway, because Atlas strings usually do not include one.
  • For Neo4j, the URI scheme decides encryption: neo4j+s:// for a CA-signed certificate (the Aura default), neo4j+ssc:// to also accept a self-signed one, and neo4j:// for an unencrypted local instance.
  • Permitted collections and Permitted node labels narrow what can be read below what the credential allows. Leave them empty to offer everything the credential can see.
Message What to check
“Connection failed” on Test connection Host, port and credentials, and that the database accepts connections from your Generate site’s network.
“Invalid SSL CA certificate” The text must be a PEM certificate with its BEGIN and END lines.
“Invalid JSON file” (BigQuery) Upload the service account key file exactly as Google issued it.
“No tables available” The login you connected with sees no tables. Grant it read access, then select Refresh.
“Processing failed” on the row Hover over the mark for the reason, fix it, then select Retry processing.
Edition Engines offered
Enterprise, consumer, storage, healthcare MySQL, PostgreSQL, Redshift, BigQuery, Snowflake, AWS Athena, Oracle DB, MariaDB, MongoDB, Neo4j, ClickHouse
Airgapped MySQL, PostgreSQL, Oracle DB, MariaDB, MongoDB, Neo4j, ClickHouse

An administrator can also hide individual engines from a team, so your list may be shorter than this.

Last updated on