Python: Upsert data

Parameters

Examples

Upsert your data

response = (
    supabase.table("countries")
    .upsert(\{"id": 1, "name": "Australia"\})
    .execute()
)

Bulk Upsert your data

response = (
    supabase.table("countries")
    .upsert([\{"id": 1, "name": "Albania"\}, \{"id": 2, "name": "Algeria"\}])
    .execute()
)

Upserting into tables with constraints

response = (
    supabase.table("users")
    .upsert(
        \{"id": 42, "handle": "saoirse", "display_name": "Saoirse"\},
        on_conflict="handle",
    )
    .execute()
)