Skip to content

melohagan/budibase-datasource-supabase

Repository files navigation

Supabase-datasource

Perform CRUD operations in Supabase

Includes:

  • Insert (Create)
  • Select (Read)
  • Upsert
  • Update
  • Delete

Official docs here: https://supabase.com/docs/reference/javascript/select

Documentation

Connecting

Provide a URL and API Key to connect:

Screenshot 2023-04-13 at 18 44 04

These can be found within your project page in Supabase:

Screenshot 2023-04-13 at 18 45 21

Click on the settings cog along the left-hand side:

Screenshot 2023-04-17 at 12 05 15

Finally click on API to see the project URL and project API keys:

Screenshot 2023-04-17 at 12 06 51

Usage

When pulling data from a table you must provide the name of the table, but also the names of the columns that you want to return.

To return all columns simply enter *.

Screenshot 2023-04-17 at 12 18 35

Note that we are returning data.data in the transformer. You can return just data if you need access to the status code and message.

Filters

Screenshot 2023-04-17 at 12 20 05

If you provide a Filter column then a filter will be applied based on the chosen operator and comparison value. There is a large list of available operators, detailed for which can be found here.

Screenshot 2023-04-17 at 12 21 51

Bindings

Like any other custom query, you can add bindings and use them in the Fields section: https://docs.budibase.com/docs/data-sources#using-query-bindings