{
 "schema_version": 1,
 "generated": "2026-10-23",
 "id": "supabase-supabase--run-server-logic-with-edge-and-database-functions",
 "repo": "supabase/supabase",
 "repo_url": "https://github.com/supabase/supabase",
 "repo_slug": "supabase-supabase",
 "title": "Run server logic with Edge and database functions",
 "page_title": "How to run server logic with Edge and database functions with Supabase",
 "summary": "Move business rules into Edge Functions or Postgres functions instead of a separate server.",
 "who": "Developer who needs custom logic, such as validating input or calling an outside service, without hosting a dedicated backend.",
 "problem": "Keeping a separate API server running for a few custom rules adds cost and deployment work.",
 "outcome": "Custom logic runs either inside Postgres as database functions or as Edge Functions called by your app.",
 "steps": [
  "Decide which logic belongs in the database, such as data checks, and which belongs in an Edge Function, such as calls to outside services.",
  "Write the database function in your Supabase project using the Database Functions guide.",
  "Write the Edge Function following the Edge Functions guide linked in the README.",
  "Call both from your app through the client library and confirm the expected response.",
  "Confirm that the function only exposes the operations you intend."
 ],
 "agent_prompt": "Using the supabase/supabase README and its Database Functions and Edge Functions docs, write one database function and one Edge Function that handle <task description>. Output both code files and a test call for each. Verify that invalid input is rejected by both.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "2 hours",
 "basis": "readme",
 "caveat": "The README lists Edge Functions and Database Functions as features but does not describe their runtime or limits, so check the linked guides for those details.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "A Supabase account at https://supabase.com/dashboard, or a self-hosted install following the self-host guide",
  "A basic understanding of Postgres tables and rows",
  "A client library for your app language, such as supabase-js for JavaScript or TypeScript, listed in the README client table"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/supabase-supabase/run-server-logic-with-edge-and-database-functions/",
 "md": "https://dedupedai.com/use-cases/supabase-supabase/run-server-logic-with-edge-and-database-functions/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/supabase-supabase--run-server-logic-with-edge-and-database-functions.json",
 "api_version": "v1"
}
