Summary
Connect is testing a per-content PostgreSQL database proxy that gives each content item its own isolated database schema. Content processes receive a CONNECT_CONTENT_DATABASE_URL environment variable with a PostgreSQL connection string scoped to their content.
It would be useful for the Python SDK to provide a factory method that makes connecting to this content database ergonomic, rather than requiring publishers to manually parse the environment variable.
Suggested API
from posit.connect import Client
client = Client()
content = client.content.current
db = content.database
# Convenience accessors
db.url # -> "postgresql://localhost:5433/abc-123"
db.host # -> "localhost"
db.port # -> 5433
db.name # -> "abc-123"
# Or direct connection
conn = db.connect() # returns a psycopg2/sqlalchemy connection
This would abstract the CONNECT_CONTENT_DATABASE_URL env var parsing and provide a clean interface for publishers building apps that use the content database feature.
Context
- The content database feature is currently gated behind
EarlyAccess.ContentDatabase in Connect.
- The env var contains a standard PostgreSQL connection string (e.g.,
postgresql://user:pass@host:port/dbname).
Summary
Connect is testing a per-content PostgreSQL database proxy that gives each content item its own isolated database schema. Content processes receive a
CONNECT_CONTENT_DATABASE_URLenvironment variable with a PostgreSQL connection string scoped to their content.It would be useful for the Python SDK to provide a factory method that makes connecting to this content database ergonomic, rather than requiring publishers to manually parse the environment variable.
Suggested API
This would abstract the
CONNECT_CONTENT_DATABASE_URLenv var parsing and provide a clean interface for publishers building apps that use the content database feature.Context
EarlyAccess.ContentDatabasein Connect.postgresql://user:pass@host:port/dbname).