Python: Fetch data

Parameters

Examples

Getting your data

response = (
    supabase.table("planets")
    .select("*")
    .execute()
)

Selecting specific columns

response = (
    supabase.table("planets")
    .select("name")
    .execute()
)

Query referenced tables

response = (
    supabase.table("orchestral_sections")
    .select("name, instruments(name)")
    .execute()
)

Query referenced tables through a join table

response = (
    supabase.table("users")
    .select("name, teams(name)")
    .execute()
)

Query the same referenced table multiple times

response = (
    supabase.table("messages")
    .select("content,from:sender_id(name),to:receiver_id(name)")
    .execute()
)

Filtering through referenced tables

response = (
    supabase.table("orchestral_sections")
    .select("name, instruments(*)")
    .eq("instruments.name", "guqin")
    .execute()
)

Querying referenced table with count

response = (
    supabase.table("orchestral_sections")
    .select("*, instruments(count)")
    .execute()
)

Querying with count option

response = (
    supabase.table("planets")
    .select("*", count="exact")
    .execute()
)

Querying JSON data

response = (
    supabase.table("users")
    .select("id, name, address->city")
    .execute()
)

Querying referenced table with inner join

response = (
    supabase.table("instruments")
    .select("name, orchestral_sections!inner(name)")
    .eq("orchestral_sections.name", "woodwinds")
    .execute()
)

Switching schemas per query

response = (
    supabase.schema("myschema")
    .table("mytable")
    .select("*")
    .execute()
)