Use parameterized queries to avoid security issues
Limit exposed queries to what your app actually needs
Manage permissions at the database or API layer
For complex logic, consider pairing PostgreSQL with a backend service
FAQs
1. What’s the recommended way to use PostgreSQL with WeWeb?
While you can connect directly with the SQL data source, most teams use Supabase as a managed Postgres layer, then connect WeWeb to Supabase via its native plugin. This gives you built‑in auth, Row Level Security, and no‑code CRUD/RPC actions while keeping raw SQL and security rules in the backend.
2. How do I query Postgres tables from WeWeb using Supabase?
Create a collection or workflow action using the Supabase “Database | Select” action and point it at the desired table or view. You can apply filters, ordering, and limits in the action config, and then bind the resulting rows to repeaters, data grids, or other elements.
3. Can I call Postgres functions (stored procedures) from WeWeb?
Yes, Supabase exposes Postgres functions as RPC endpoints, and WeWeb has a “Call a Postgres function” workflow action for them. You pass parameters from variables, run the function, and capture its return value in a variable for use in the UI or subsequent logic.
4. How do security and Row Level Security (RLS) interact with WeWeb?
RLS policies defined in Supabase apply to all Postgres queries made from WeWeb, including selects and function calls. You must explicitly allow access in RLS for the roles/tokens used by WeWeb, or queries will fail or return no rows.
5. When would I use the generic SQL data source directly with PostgreSQL?
Direct SQL connections are mainly used for internal tools, trusted environments, or quick prototypes where exposing SQL from the client is acceptable. For public apps, consider hiding Postgres behind Supabase or a custom API because of security, IP allow‑listing, and query‑exposure risks.
6. Can I mix Postgres data with other backends inside WeWeb?
Yes, Postgres/Supabase collections can be combined with other collections (REST, Xano, etc.) using WeWeb’s “joining data” and formula tools. This allows patterns like enriching Postgres rows with external API data or joining across multiple sources before rendering dashboards.