Skip to main content

Supabase

We all love Supabase, if you're an existing user you'll know how powerful it is. If you're not, you should check it out, it's the ideal database for getting started with Comnoco.

Supabase Logo

Comnoco has native blocks to make connecting to and using Supabase really easy.

Supabase Blocks

If you don't like the idea of writing and maintaining edge functions then you can write no-code functions and harness the power of Comnoco instead. You're welcome. 🙂

Use Supabase for:

  • Your Database
  • To trigger your Comnoco no-code functions when records change
  • User Authentication
  • Realtime Broadcasting
  • Object Storage
  • and more...

Database

Comnoco Supabase Database blocks to allow you to connect to your Supabase databases to:

  • Query/Read Records
  • Create Records
  • Update Records
  • Upsert Records (create new if they don't exist or update if they do)
  • Delete records
  • Run Functions / Stored Procedures

Supabase Query Builder

It integrates with the full power of Supabase to allow advanced filtering (queries). The block has a Query Builder popup (accessed in the properties panel on the right) that allows you to visually build queries from either static or mapped data. This query is then translated into a data structure on the Comnoco tree so that it can be programmed however you want.

tip
  • If you are wanting to try something without impacting what you have, duplicate your block first to save accidental changes to what you have.
  • Comnoco allows you to access all of your Supabase schemas, you will need to set up Supabase so that you can use them.

Trigger a Comnoco Function When a Supabase Row Changes

It's really easy to watch for changes in a Supabase database table and have any changes trigger a function in Comnoco.

tip

This is really useful for when new users sign up - you can get their details from the inbuilt Supabase users table and add them to your own profiles table that can hold custom items such as user preferences.

In Comnoco:

  1. Add a Webhook Receiver function in a comnoco logix file. Webhook Receiver
  2. Create a Trigger, set it to type Webhook and link it to your function. Webhook Trigger
  3. Publish it and get (copy) its URL from the status screen. Webhook URL

In Supabase:

  1. Create a new Database Webhook in the Supabase Dashboard. You can do this by going to the Webhooks section of your project. Supabase Webhook
  2. Paste in your Comnoco URL Supabase Webhook URL

And that's it, you will have a Comnoco function that runs when your table is updated.

tip

If you want to capture data to develop with, you can right click on your function and capture data directly into its input parameters.

Capture Capture Result

Auth

Authorising in Triggers

You can use the JWT (JSON Web Token) of a logged in Supabase user buy adding the Supabase JWT block underneath the Authenticate and Authorise block in your trigger Authentication.

Authentication in Logix files

Comnoco has Supabase Authentication blocks to create and log in in users.

Broadcast

With the Supabase Broadcast block you can broadcast a message to a Supabase realtime channel. We recommend using the Realtime Inspector to test your broadcast message from Comnoco.