Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Adding `upsert` into Readme
  • Loading branch information
mrpbennett authored Jul 20, 2023
1 parent cb8566a commit b5ade74
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,24 @@ supabase: Client = create_client(url, key)
data = supabase.table("countries").update({"country": "Indonesia", "capital_city": "Jakarta"}).eq("id", 1).execute()
```

### Update data of duplicate keys

```python
from supabase import create_client, Client

url: str = os.environ.get("SUPABASE_TEST_URL")
key: str = os.environ.get("SUPABASE_TEST_KEY")
supabase: Client = create_client(url, key)

country = {
"country": "United Kingdom",
"capital_city": "London" # this was missing when it was added
}

data = supabase.table("countries").upsert(country).execute()
assert len(data.data) > 0
```

### Deletion of Data

```python
Expand Down

0 comments on commit b5ade74

Please sign in to comment.