Skip to content

Databases

Database providers cover both SQL databases and document databases. SQL providers use onequery query exec; MongoDB uses the Source API path.

ProviderProvider IDConnection notes
PostgreSQLpostgresHost, port, database, username, password, and SSL mode.
SupabasesupabaseUses the Postgres wire protocol, typically through the Supabase session pooler.
MySQLmysqlHost, port, database, username, password, and SSL mode.
MongoDBmongodbConnection string plus database selection.
Terminal window
onequery source connect --source postgres \
--input '{"sourceKey":"warehouse","credentials":{"host":"db.example.com","port":5432,"database":"app","username":"onequery_readonly","password":"<read-only-password>","sslMode":"require"}}'

Run a query:

Terminal window
onequery query exec \
--source postgres://warehouse \
--sql "select id, created_at from users order by created_at desc limit 20"

Use the session pooler host from the Supabase Connect panel. Keep SSL enabled and use a role with only the table or schema access required for the workflow.

  • Use a read-only user for production.
  • Prefer replica or analytics databases when available.
  • Limit schemas and tables at the database permission layer.
  • Use explicit columns and limit clauses in agent queries.

Cloudflare D1 is covered with warehouse-style SQL sources because its provider ID, cloudflare_d1, is grouped with OneQuery warehouse providers.