Added

PostgreSQL Data Source Support

Connect directly to PostgreSQL databases for AI-powered analytics. Bobsled AI now supports PostgreSQL alongside Snowflake and Sledhouse, enabling natural language queries against your existing PostgreSQL infrastructure.

What's New

  • PostgreSQL Data Source Type: Create data sources with type: "postgres" to connect to any PostgreSQL-compatible database
  • Stateless Connection Testing: Validate PostgreSQL connections before saving using the test-connection endpoint
  • SSL Mode Support: Configure SSL with disable, require, verify-ca, or verify-full modes
  • Schema Selection: Specify a default schema for queries (defaults to public)

New API Capabilities

Data Source Type

The type field on data sources now accepts postgres in addition to snowflake and sledhouse:

{
  "name": "Production PostgreSQL",
  "type": "postgres",
  "connectionConfig": {
    "type": "postgres",
    "connectionString": "<base64-encoded-connection-string>",
    "isEncoded": true,
    "sslMode": "require",
    "defaultSchema": "public"
  }
}

Test Connection (Stateless)

POST /api/v1/accounts/{accountId}/data-sources/test-connection

Test PostgreSQL connectivity before creating a data source:

{
  "connectionConfig": {
    "type": "postgres",
    "connectionString": "<base64-encoded-connection-string>",
    "isEncoded": true,
    "sslMode": "require"
  }
}

Response on success:

{
  "ok": true,
  "data": {
    "success": true,
    "message": "Connection successful",
    "details": {
      "type": "postgres",
      "postgresVersion": "16.1",
      "currentUser": "bobsled_user",
      "currentDatabase": "analytics",
      "accessibleSchemas": ["public", "sales", "reporting"]
    }
  }
}

Connection Configuration

FieldRequiredDefaultDescription
connectionStringYes-PostgreSQL connection string (base64-encoded by default)
isEncodedNotrueWhether the connection string is base64-encoded
sslModeNo-SSL mode: disable, require, verify-ca, verify-full
defaultSchemaNopublicDefault schema for queries

Security Notes

  • AES-256-GCM Encryption: Connection strings are encrypted at rest using AES-256-GCM before storage. Credentials are never stored in plaintext in the database.
  • Connection strings should be base64-encoded in API requests to safely transmit special characters
  • Use sslMode: "require" or stricter for production databases
  • Bobsled enforces SELECT-only queries for end-user requests to prevent data modification