forked from blacktrub/onion-spider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.py
42 lines (35 loc) · 1.15 KB
/
client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
from supabase_py 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)
user = supabase.auth.sign_up(
email='[email protected]',
password='example-password',
)
###
import os
from supabase_py 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)
user = supabase.auth.sign_in(
email='[email protected]',
password='example-password'
)
###
import os
from supabase_py 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)
data = supabase.table('countries').select('name').execute()
###
data = supabase.table('cities').insert({'name': 'Gotham', 'country_id': 556 }).execute()
# assert if insert response 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()