Documentation Index
Fetch the complete documentation index at: https://docs.emergence.ai/llms.txt
Use this file to discover all available pages before exploring further.
Connect a PostgreSQL Database
This guide walks you through registering a PostgreSQL database as a data connection in CRAFT. Once connected, the database is available to solutions like Data Insights (for NL-to-SQL queries) and Data Governance (for profiling and enrichment).Prerequisites
Before you begin, ensure you have:
- A running CRAFT instance
- A valid JWT token with the
developeroradminrole - Network connectivity between the platform and your PostgreSQL instance
- A PostgreSQL user with read access to the target schemas
How Data Connections Work
Data connections are managed by the Assets service (port 8002). When you register a connection:- The connection metadata (host, port, database name) is stored in the Assets database
- Credentials (username, password) are stored securely via the platform Secrets API (Infisical or ESO + GCP Secret Manager) — never in the Assets database
- Solutions retrieve the connection at runtime via the Assets SDK and use the credentials to establish a live database session
- All connections are scoped to an organization and project for multi-tenant isolation
Step 1: Prepare Your Database
Ensure your PostgreSQL instance is configured to accept connections from the platform.Configure network access
Update Reload the configuration:
pg_hba.conf to allow connections from the platform’s network:Step 2: Register the Data Connection
Use the Assets API to register the connection in the platform.The
credentials field is encrypted and stored via the platform Secrets API upon registration. It will not appear in subsequent GET responses.Step 3: Test the Connection
Verify the platform can reach your database:Step 4: Use the Connection with Data Insights
Once registered, the Data Insights solution can use this connection for natural-language queries:Connection Configuration Reference
- PostgreSQL
- Credentials
| Parameter | Type | Required | Description |
|---|---|---|---|
host | string | Yes | Database hostname or IP |
port | integer | No | Port number (default: 5432) |
database | string | Yes | Database name |
schema | string | No | Default schema (default: public) |
ssl_mode | string | No | SSL mode: disable, require, verify-ca, verify-full |
Security Considerations
Credential Storage
Credential Storage
Credentials are stored via the platform Secrets API (backed by Infisical or ESO + GCP Secret Manager). They are encrypted at rest and organization-scoped. Credentials are injected at runtime only when a solution needs to establish a connection.
Network Security
Network Security
Configure your database firewall to accept connections only from the platform’s Kubernetes cluster CIDR. Use
ssl_mode: verify-full for production deployments to prevent man-in-the-middle attacks.Principle of Least Privilege
Principle of Least Privilege
Always create a dedicated read-only user for the platform. Never use a superuser or an account with write privileges unless the solution explicitly requires write access.
Troubleshooting
Connection test fails with timeout
Connection test fails with timeout
Verify network connectivity between the Kubernetes cluster and your database. Check firewall rules, security groups, and
pg_hba.conf configuration. Ensure the database host is resolvable from within the cluster.Authentication failure
Authentication failure
Confirm the username and password are correct. Check that the user exists in the target database and has the
CONNECT privilege. Verify the pg_hba.conf entry allows the authentication method being used.SSL connection required
SSL connection required
If your database requires SSL, set
ssl_mode to require or higher. For verify-ca and verify-full, ensure the platform has access to the CA certificate.Next Steps
Chat with Data
Learn how to ask natural-language questions against your connected database.
Data Profiling
Profile your connected database to understand data quality and structure.
Backup & Restore
Learn how to back up your platform data including connection configurations.
Network Security
Review network security policies for data connections.

