mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 20:35:07 +03:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? Replaces "stored procedures" with "functions" for everything related to the Data API. ## Additional context It's not accurate to call database functions "stored procedures". It may have been that way before Postgres 11, but now it causes confusion because PostgREST allows functions and not stored procedures. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Standardized terminology across docs, SDK guides, CLI/config specs, examples, UI, and config comments to use "database functions" instead of "stored procedures". * Updated API docs, CLI/config descriptions, Studio UI labels, help text, empty-state and navigation copy, RPC documentation, and example text for consistency. * Adjusted explanatory text and error/help messages to reflect the revised terminology. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
AI Inference in Supabase Edge Functions
Since Supabase Edge Runtime v1.36.0 you can run the gte-small model natively within Supabase Edge Functions without any external dependencies! This allows you to easily generate text embeddings without calling any external APIs!
Semantic Search with pgvector and Supabase Edge Functions
This demo consists of three parts:
- A
generate-embeddingdatabase webhook edge function which generates embeddings when a content row is added (or updated) in thepublic.embeddingstable. - A
query_embeddingsPostgres function which allows us to perform similarity search from an egde function via Remote Procedure Call (RPC). - A
searchedge function which generates the embedding for the search term, performs the similarity search via RPC function call, and returns the result.
Deploy
- Link your project:
supabase link - Deploy Edge Functions:
supabase functions deploy - Update project config to enable webhooks:
supabase config push - Navigate to the database-webhook migration file and insert your
generate-embeddingfunction details. - Push up the database schema
supabase db push
Run
Run a search via curl POST request:
curl -i --location --request POST 'https://<PROJECT-REF>.supabase.co/functions/v1/search' \
--header 'Authorization: Bearer <SUPABASE_ANON_KEY>' \
--header 'Content-Type: application/json' \
--data '{"search":"vehicles"}'