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.
Comnoco has native blocks to make connecting to and using Supabase really easy.
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
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.
- 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.
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:
- Add a
Webhook Receiver
function in a comnocologix
file. - Create a
Trigger
, set it to typeWebhook
and link it to your function. - Publish it and get (copy) its URL from the status screen.
In Supabase:
- Create a new Database Webhook in the Supabase Dashboard. You can do this by going to the
Webhooks
section of your project. - Paste in your Comnoco URL
And that's it, you will have a Comnoco function that runs when your table is updated.
If you want to capture data to develop with, you can right click on your function and capture data directly into its input parameters.
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.