Supabase Compatibility
The table endpoints follow the PostgREST convention.
@supabase/supabase-jsconnects without a single change to your code.
If you already have code written against Supabase, swapping the URL and the key is the whole migration.
Connecting
import { createClient } from "@supabase/supabase-js";
const gridie = createClient("https://gridie.ai", process.env.GRIDIE_API_KEY);
const { data, error } = await gridie
.from("orders")
.select("id, customer, total")
.eq("status", "paid")
.order("created_at", { ascending: false })
.limit(20);The client sends the key in an apikey header on its own, so there are no headers for you to add.
Pass the origin only. A URL with a path, such as https://gridie.ai/api/v1, loses its last segment when the client builds the request.
Method mapping
| Client code | Actual request |
|---|---|
.select("id, name") | GET ?select=id,name |
.eq("status", "paid") | ?status=eq.paid |
.neq .gt .gte .lt .lte | ?column=operator.value |
.like .ilike | ?name=like.Ada* |
.is("paid_at", null) | ?paid_at=is.null |
.in("status", ["paid", "shipped"]) | ?status=in.(paid,shipped) |
.not("status", "eq", "paid") | ?status=not.eq.paid |
.order("created_at", { ascending: false }) | ?order=created_at.desc |
.limit(20) | ?limit=20 |
.range(0, 19) | ?offset=0&limit=20 |
.single() .maybeSingle() | Accept: application/vnd.pgrst.object+json |
.select("*", { count: "exact" }) | Prefer: count=exact |
.insert(rows) | POST |
.upsert(rows) | POST with Prefer: resolution=merge-duplicates |
.update(values).eq(...) | PATCH ?... |
.delete().eq(...) | DELETE ?... |
.insert(rows).select() | Prefer: return=representation |
Other languages
Supabase ships clients for several languages. They speak the same protocol, so supabase-py, supabase-flutter and the rest work once you change the URL and the key.
import os
from supabase import create_client
gridie = create_client("https://gridie.ai", os.environ["GRIDIE_API_KEY"])
rows = gridie.table("orders").select("*").eq("status", "paid").execute()If you plan to build requests without a client, see REST API.
Last updated on