-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add common issues to Supabase node (#2724)
- Loading branch information
1 parent
5f3ed73
commit cdb4302
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
docs/integrations/builtin/app-nodes/n8n-nodes-base.supabase/common-issues.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4 | ||
title: Supabase node common issues | ||
description: Documentation for common issues and questions in the Supabase node in n8n, a workflow automation platform. Includes details of the issue and suggested solutions. | ||
contentType: integration | ||
priority: high | ||
--- | ||
|
||
# Supabase node common issues | ||
|
||
Here are some common errors and issues with the [Supabase node](/integrations/builtin/app-nodes/n8n-nodes-base.supabase/) and steps to resolve or troubleshoot them. | ||
|
||
## Filtering rows by metadata | ||
|
||
To filter rows by [Supabase metadata](https://supabase.com/docs/guides/ai/python/metadata), set the **Select Type** to **String**. | ||
|
||
From there, you can construct a query in the **Filters (String)** parameter to filter the metadata using the [Supabase metadata query language](https://supabase.com/docs/guides/ai/python/metadata#metadata-query-language), inspired by the [MongoDB selectors](https://www.mongodb.com/docs/manual/reference/operator/query/) format. Access the metadata properties using the [Postgres `->>` arrow JSON operator](https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-PROCESSING) like this (curly brackets denote components to fill in): | ||
|
||
``` | ||
metadata->>{your-property}={comparison-operator}.{comparison-value} | ||
``` | ||
|
||
For example to access an `age` property in the metadata and return results greater than or equal to 21, you could enter the following in the **Filters (String)** field: | ||
|
||
``` | ||
metadata->>age=gte.21 | ||
``` | ||
|
||
You can combine these operators to construct more complex queries. | ||
|
||
## Can't connect to a local Supabase database when using Docker | ||
|
||
When you run Supabase in Docker, you need to configure the network so that n8n can connect to Supabase. | ||
|
||
The solution depends on how you're hosting the two components. | ||
|
||
### If only Supabase is in Docker | ||
|
||
If only Supabase is running in Docker, the Docker Compose file used by the [self-hosting guide](https://supabase.com/docs/guides/self-hosting/docker) already runs Supabase bound to the correct interfaces. | ||
|
||
When configuring [Supabase credentials](/integrations/builtin/credentials/supabase/), the `localhost` address should work without a problem (set the **Host** to `localhost`). | ||
|
||
### If Supabase and n8n are running in separate Docker containers | ||
|
||
If both n8n and Supabase are running in Docker in separate containers, you can use Docker networking to connect them. | ||
|
||
Configure Supabase to listen on all interfaces by binding to `0.0.0.0` inside of the container (the official [Docker compose configuration](https://supabase.com/docs/guides/self-hosting/docker) already does this this). Add both the Supabase and n8n components to the same [user-defined bridge network](https://docs.docker.com/engine/network/drivers/bridge/) if you aren't already managing them together in the same Docker Compose file. | ||
|
||
When configuring [Supabase credentials](/integrations/builtin/credentials/supabase/), use the Supabase API gateway container's name (`supabase-kong` by default) as the host address instead of `localhost`. For example, if you use the default configuration, you would set the **Host** to `http://supabase-kong:8000`. | ||
|
||
## Records are accessible through Postgres but not Supabase | ||
|
||
If queries for records return empty using the Supabase node, but are available through the [Postgres](/integrations/builtin/app-nodes/n8n-nodes-base.postgres/) node or with a Postgres client, there may be a conflict with Supabase's [Row Level Security (RLS)](https://supabase.com/docs/guides/database/postgres/row-level-security) policy. | ||
|
||
Supabase always enables RLS when you create a table in a public schema with the Table Editor. When RLS is active, the API doesn't return any data with the public `anon` key until you create policies. This is a security measure to ensure that you only expose data you intend to. | ||
|
||
To access data from a table with RLS enabled as the `anon` role, [create a policy](https://supabase.com/docs/guides/database/postgres/row-level-security#creating-policies) to enable the access patterns you intend to use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters