4 ms·
Thanks. If you're writing functions, though, it seems like nearly as much work as writing traditional endpoints, no?
by DidYaWipe 1y ago
Thanks. If you're writing functions, though, it seems like nearly as much work as writing traditional endpoints, no?
- steve-chavez 1y agoNot really, the work is much reduced. 1. If your function returns a table type, you can reuse all the filters that PostgREST offers on regular tables or views [1]. 2. The SQL code will be much more concise (and performant, which leads to less maintenance work) than the code of a backend programming language. 3. The need for migrations is a common complaint, but you can treat SQL as regular code and version control it. Supabase recently released some tooling [2] that helps with this. [1]: https://docs.postgrest.org/en/v12/references/api/functions.html#table-valued-functions https://docs.postgrest.org/en/v12/references/api/functions.h... [2]: https://supabase.com/docs/guides/local-development/declarative-database-schemas https://supabase.com/docs/guides/local-development/declarati...