Database Integrations
Pywa Cloud doesn’t host a database for you — an order-tracking bot, a conversation log, or anything else your bot needs to persist brings its own database, the same as any other secret (see Environment Variables & Secrets). What Pywa Cloud does do is make linking an existing database less annoying: connect your provider account once, pick the database for each bot, and its connection string is saved into the bot for you.
Two providers are supported today: Neon and Supabase (both serverless Postgres). Pywa Cloud only asks for read access to your account and never creates, changes or deletes anything there. Redis Cloud and Logfire are not offered yet.
Connect your account (once per team)
Section titled “Connect your account (once per team)”A team admin or owner opens the team page in the dashboard, finds Integrations and clicks Connect next to the provider. You approve read-only access on the provider’s own consent screen and land back in the dashboard.
Link a database to a bot
Section titled “Link a database to a bot”Open the bot’s Integrations tab and click Link a database:
- Supabase: pick the project, then type the project’s database password. Supabase never shares it with anyone, so it has to come from you; if you’ve forgotten it, reset it in the project’s database settings.
- Neon: pick the organization (if you have several), the project, the branch and the database. No password to type.
You can change the environment variable name (default DATABASE_URL), for example to
SUPABASE_DATABASE_URL if DATABASE_URL is already taken. Pywa Cloud won’t overwrite a variable
that already exists on the bot. The connection string is saved as an encrypted secret and is never
shown again; the tab only shows the variable’s name.
Check what’s linked at any time in the bot’s Integrations tab.
Using it in your code
Section titled “Using it in your code”import osimport psycopg # or your driver of choice
conn = psycopg.connect(os.environ["DATABASE_URL"])Nothing Pywa-specific here — DATABASE_URL is a plain env var like any other secret this platform
injects, in the standard postgres://user:password@host/dbname shape.
What this doesn’t do
Section titled “What this doesn’t do”Linking a database doesn’t trigger a redeploy on its own — your running bot doesn’t see the new
variable until your next real pywa deploy. This is deliberate: an unprompted redeploy is a real
side effect (a brief downtime window, per Deploying a Pywa Bot’s redeploy
strategy).
Unlinking a database (bot’s Integrations tab) deletes its variable from that bot. Disconnecting a provider (team page) removes the team’s access and every link made through it, but the variables already written stay on the bots, since they don’t depend on the connection.
This also isn’t a managed-database product — Pywa Cloud never sees your database’s actual data, only the connection string, and has no involvement in backups, scaling, or billing for it beyond what you already have with the provider directly.