Merge pull request #3162 from sureshdsk/python-insert-doc

added example for insert and filtering using python
This commit is contained in:
Copple authored and GitHub committed 2021-09-12 10:16:41 +08:00
commit 4fa60c60f1
1 file changed
+13 -2
+13 -2
View File
@@ -313,7 +313,9 @@ const { data, error } = await supabase
<TabItem value="py">
```py
# Not yet implemented
data = supabase.table('cities').select('name, country_id').eq('name', 'Germany').execute()
# Assert we pulled real data.
assert len(data.get("data", [])) > 0
```
@@ -367,7 +369,16 @@ const { data, error } = await supabase
<TabItem value="py">
```py
# Not yet implemented
data = supabase.table('cities').insert({'name': 'Gotham', 'country_id': 556 }).execute()
# assert if insert resonse is a success
assert data.get("status_code") in (200, 201)
# bulk insert
data = supabase.table('cities').insert([
{'name': 'Gotham', 'country_id': 556 },
{'name': 'The Shire', 'country_id': 557 }
).execute()
```