The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Adds function hooks
Paul Copplestoned5a896aba3c4
diff --git a/www/_blog/2021-07-30-supabase-functions-updates.mdx b/www/_blog/2021-07-30-supabase-functions-updates.mdxindex 773c37eba11..b392adf7e88 100644--- a/www/_blog/2021-07-30-supabase-functions-updates.mdx+++ b/www/_blog/2021-07-30-supabase-functions-updates.mdx@@ -28,9 +28,9 @@ Let's cover the features we're launching today before the item that every one isPostgres has built-in support for [SQL functions](https://www.postgresql.org/docs/current/sql-createfunction.html). Today we're making it even easier for developers to build PostgreSQL Functions by releasing a native Functions editor. Soon we'll release some handy templates!--++You can call PostgreSQL Functions with `supabase-js` using your project API [[Docs](https://supabase.io/docs/reference/javascript/rpc)]:@@ -47,7 +47,7 @@ const { data, error } = await supabaseWhile triggers are a staple of Database Administrators, they can be a bit complex and hard to use. We plan to change that with a simple interface for building and managing PostgreSQL triggers.-+## Supabase Functions@@ -74,7 +74,7 @@ To meet these goals, we're releasing Supabase Functions in stages:Today we're releasing Functions Hooks in `ALPHA`. The `ALPHA` tag means that it is NOT stable, but it's available for testing and feedback. The API will change, so do not use it for anything critical. You have been warned.-+Hooks? Triggers? Firestore has the concept of [Function Triggers](https://firebase.google.com/docs/functions/firestore-events), which are very cool.Supabase Hooks are the same concept, just with a different name.@@ -84,6 +84,8 @@ Postgres already has the concept of [Triggers](https://www.postgresql.org/docs/cFunction Hooks allow you to "listen" to any change in your tables to trigger an asynchronous Function. You can hook into a few different events:`INSERT`, `UPDATE`, and `DELETE`. All events are fired **after** a database row is changed. Keen eyes will be able to spot the similarity to Postgres triggers, and that's because Function Hooks are just a convenience wrapper around triggers.++### Hook TargetsSupabase will support several different targets.diff --git a/www/public/images/blog/functions-updates/hook-events.png b/www/public/images/blog/functions-updates/hook-events.pngnew file mode 100644index 00000000000..756ad9cd34bBinary files /dev/null and b/www/public/images/blog/functions-updates/hook-events.png differdiff --git a/www/public/images/blog/functions-updates/og-supabase-hooks.jpg b/www/public/images/blog/functions-updates/og-supabase-hooks.jpgindex 70e88a77a96..007bad66cec 100644Binary files a/www/public/images/blog/functions-updates/og-supabase-hooks.jpg and b/www/public/images/blog/functions-updates/og-supabase-hooks.jpg differdiff --git a/www/public/images/blog/functions-updates/postgres-functions.png b/www/public/images/blog/functions-updates/postgres-functions.pngnew file mode 100644index 00000000000..85fa386106fBinary files /dev/null and b/www/public/images/blog/functions-updates/postgres-functions.png differdiff --git a/www/public/images/blog/functions-updates/postgres-triggers.png b/www/public/images/blog/functions-updates/postgres-triggers.pngnew file mode 100644index 00000000000..26ab467b47cBinary files /dev/null and b/www/public/images/blog/functions-updates/postgres-triggers.png differdiff --git a/www/public/images/blog/functions-updates/supabase-function-hooks.png b/www/public/images/blog/functions-updates/supabase-function-hooks.pngnew file mode 100644index 00000000000..dd19502d02bBinary files /dev/null and b/www/public/images/blog/functions-updates/supabase-function-hooks.png differdiff --git a/www/public/images/blog/functions-updates/thumb-supabase-hooks.jpg b/www/public/images/blog/functions-updates/thumb-supabase-hooks.jpgindex 6f06e39265a..ecf70548104 100644Binary files a/www/public/images/blog/functions-updates/thumb-supabase-hooks.jpg and b/www/public/images/blog/functions-updates/thumb-supabase-hooks.jpg differ