BeginnerVector Database10 min read

Connect Supabase to Gateco

Connect Supabase to Gateco for policy-aware vector retrieval. Covers pgvector extension setup, service role key, and Supabase connector configuration.

Last updated: May 21, 2026

Prerequisites

  • A Supabase project (free tier supported)
  • pgvector extension enabled in your project

Overview — 5 steps

  1. 1Enable the pgvector extension
  2. 2Get your database connection string
  3. 3Get your service role key
  4. 4Add the connector in Gateco
  5. 5Configure search settings

Supabase is a managed Postgres platform with built-in pgvector, auth, and realtime. Gateco connects to Supabase as a Tier 1 connector, supporting full document ingestion, retroactive registration, and RAG access control over your vector tables — adding identity-aware retrieval and vector database RBAC without modifying your existing schema.

Step 1 — Enable the pgvector extension

  1. In the Supabase dashboard, open your project.
  2. Navigate to Database → Extensions.
  3. Search for "vector" and toggle it on.

Or run this in the Supabase SQL editor:

sql
CREATE EXTENSION IF NOT EXISTS vector;

Step 2 — Get your database connection string

  1. Navigate to Project Settings → Database.
  2. Under "Connection string", select the URI tab.
  3. Switch to "Direct connection" (not the Supabase connection pooler).
  4. Copy the URI. It will look like:
text
postgresql://postgres:[YOUR-PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres

Use the direct connection string (port 5432), not the pooler (port 6543). Gateco manages its own connection pool internally.

Step 3 — Get your service role key

  1. Navigate to Project Settings → API.
  2. Under Project API keys, copy the service_role key (labeled "secret").
  3. Keep this key secure — it bypasses Row Level Security.

The service role key bypasses Supabase RLS. Store it securely and do not expose it in client-side code. Gateco uses it server-side only.

Step 4 — Add the connector in Gateco

  1. Navigate to Connectors → Add connector → Supabase.
  2. Paste your direct connection string from Step 2.
  3. Click Test connection.
  4. Click Save.

Step 5 — Configure search settings

  1. Click your Supabase connector → Search config.
  2. Set the Vector table name (e.g. documents).
  3. Set the Embedding column (e.g. embedding).
  4. Optionally set Content column and additional Metadata columns.
  5. Save.

Configuration reference

FieldExampleDescription
connection_stringpostgresql://postgres:pass@db.xxx.supabase.co:5432/postgresDirect PostgreSQL connection URI
table_namedocumentsTable containing vector embeddings
embedding_columnembeddingColumn with type vector(n)
content_columncontentDocument text column (optional)

Troubleshooting

ErrorCauseFix
Relation "vector_extension" does not existpgvector not enabledEnable the vector extension in Database → Extensions
permission denied for schemaUsing anon key instead of service roleUse the service_role key from Project Settings → API
SSL requiredMissing sslmode parameterAdd ?sslmode=require to the connection string

Frequently asked questions

Do I need to enable the pgvector extension before connecting Gateco?

Yes. Gateco requires the vector extension to be present in the database to create vector indexes and run similarity searches. In Supabase, go to Database → Extensions, search for "vector", and toggle it on. Alternatively, run CREATE EXTENSION IF NOT EXISTS vector in the Supabase SQL editor.

Should I use the anon key or the service role key?

Use the service role key (the long secret starting with eyJ...). The anon key is restricted by Row Level Security policies, which would block Gateco from reading the data it needs to apply its own policy layer. The service role key bypasses RLS — Gateco then applies its own access policies on top.

Does Gateco replace Supabase Row Level Security?

No. Supabase Row Level Security and Gateco address different layers. RLS restricts which rows a PostgreSQL role can read at the database level. Gateco provides vector database RBAC and RAG access control at the retrieval layer — gating which search results an end user's AI agent receives based on identity policies. They are complementary: keep your existing RLS rules and add Gateco's policy enforcement on top.

Ready to add policy-aware retrieval?

Connect your Supabase setup to Gateco in under 5 minutes.