by marcus_cemes · 4y ago · 0 comments
> However, Supabase already offers a flexible solution for that - Database Functions! As such, for Supabase [Edge] Functions, we decided to deploy far-and-wide so that they are as close to your end-users as possible.
Does this mean that a choice has to be made between high latency (Edge Functions) and specialised SQL-only functions (Database Functions)? I see that cron-like triggers are still on the roadmap, is there a plan to have TypeScript functions that can run close to the database (or other resources)? Call me new school (as in not old school), but I prefer processing complex queries in a language that I feel comfortable working in, SQL is not that.
I know a lot of folks are huge fans of writing pure SQL, the lack of type safety and lack of good intergration with source control (I dream of a world where database schemas, functions, security access and the rest can be saved to source control for reproducibility) scare me.
We are also exploring running Deno directly inside your database - https://github.com/supabase/postgres-deno
Just to double-up on Inian's comment - there is definitely a world where this happens, perhaps even inside the database itself (like plv8). We were focused on the Edge experience this time, but I'm excited about the future that an open-source TS runtime like Deno enables.
> I dream of a world where database schemas, functions, security access and the rest can be saved to source control for reproducibility
this was one of the main reasons we started supabase. we hope to make database development as easy as application development
Hey there are some migration tools that play nice with source control. For example, Flyway has repeatable migrations https://flywaydb.org/documentation/tutorials/repeatable, here's some links about this
https://stackoverflow.com/questions/25839666/flyway-strategy...
(Disclaimer, I am the author of it)