Skip to content

Database Integrations

AutoDB connects to any PostgreSQL database. The setup varies slightly by provider — mainly around SSL mode, connection string format, and network access. This guide covers each supported provider.

Every provider uses a standard PostgreSQL URI:

postgresql://USERNAME:PASSWORD@HOST:PORT/DATABASE

AutoDB encrypts connection strings at rest using Fernet symmetric encryption. Credentials are never returned by the API after registration.

db_type: supabase

Supabase provides a managed PostgreSQL database with connection pooling via Supavisor.

Find your credentials:

  1. Open your Supabase project dashboard
  2. Go to Settings > Database
  3. Copy the Connection string under “Direct connection” (not the pooled connection)

Connection details:

FieldValue
Hostdb.<project-ref>.supabase.co
Port5432 (direct) or 6543 (pooled via Supavisor)
Databasepostgres
SSL Moderequire

Register via API:

Terminal window
curl -X POST https://api.autodb.app/api/v1/connections \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"name": "Supabase Production",
"db_type": "supabase",
"connection_string": "postgresql://postgres.xxxx:YOUR_PASSWORD@db.xxxx.supabase.co:5432/postgres"
}'

Network access:

Supabase databases are publicly accessible by default with SSL enforced. No IP allowlisting is required unless you have restricted network policies enabled in your project settings.

AutoDB supports three SSL modes:

ModeBehaviorUse when
requireEncrypted connection required, server certificate not verifiedCloud-hosted databases (default)
preferUses SSL if available, falls back to unencryptedMixed environments
disableNo encryptionLocal development only

The default SSL mode is require. You can override it by appending ?sslmode=disable or ?sslmode=prefer to your connection string, or by selecting the mode in the dashboard connection form.

Create a dedicated PostgreSQL user for AutoDB with the minimum permissions needed:

-- Read-only access (introspection + query optimization)
CREATE USER autodb_reader WITH PASSWORD 'secure_password';
GRANT CONNECT ON DATABASE mydb TO autodb_reader;
GRANT USAGE ON SCHEMA public TO autodb_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO autodb_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO autodb_reader;
-- If you want AutoDB to execute migrations, add write access:
GRANT CREATE ON SCHEMA public TO autodb_reader;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO autodb_reader;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO autodb_reader;

Once your database is registered, run an introspection to index your schema:

Terminal window
curl -X POST https://api.autodb.app/api/v1/connections/CONNECTION_ID/introspect \
-H "X-API-Key: YOUR_API_KEY"

This creates a schema snapshot that powers migration analysis, query optimization, and context retrieval. Re-run introspection after schema changes to keep AutoDB up to date.