mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Merge pull request #3162 from sureshdsk/python-insert-doc
added example for insert and filtering using python
This commit is contained in:
1 file changed
+13
-2
@@ -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()
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user