https://supabase.com/ logo
#help
Title
# help
u

アレラーノ・ケビン

03/31/2022, 12:49 AM
I am getting this error message when attempting to connect to Supabase table.
n

Needle

03/31/2022, 12:49 AM
Hello ! This thread has been automatically created from your message in a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
u

アレラーノ・ケビン

03/31/2022, 12:50 AM
@User, hey how are you guys doing?
n

Needle

03/31/2022, 12:50 AM
🆕 raise Exception(supabase_url is required)
u

アレラーノ・ケビン

03/31/2022, 12:50 AM
So cool lol
main.py
Copy code
python
import os
from supabase import create_client, Client

url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_KEY")
supabase: Client = create_client(url, key)
variable.env
Copy code
env
export SUPABASE_URL="https://stuqhyhalkjsylaquudg.supabase.co"
export SUPABASE_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InN0dXFoeWhhbGtqc3lsYXF1dWRnIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTY0ODY1NzQ0MSwiZXhwIjoxOTY0MjMzNDQxfQ.VBNzLcLOoJ0dCl4jmlc0II_lDZGCoogrH0ylpsCJ6XE"
g

garyaustin

03/31/2022, 1:03 AM
I don't use python, but seems like your code is not passing the url to the client init from the error. Is there a way to "console.log" your url and key right before you init the client?
n

Needle

03/31/2022, 1:03 AM
raise Exception(supabase_url is required)
u

アレラーノ・ケビン

03/31/2022, 1:18 AM
Oh my god, I'm so dumb lol
Gary thank you so much
main.py
Copy code
python
import os
from supabase import create_client, Client
import dotenv

dotenv.load_dotenv('variable.env')

url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_KEY")
supabase: Client = create_client(url, key)
data = supabase.table("table_name").select("*").execute()
# Assert we pulled real data.
assert len(data.data) > 0

print(data)
Missing file name lol
Copy code
python
dotenv.load_dotenv('variable.env')
g

garyaustin

03/31/2022, 1:20 AM
@User So I can add python to my resume now?😂
u

アレラーノ・ケビン

03/31/2022, 1:21 AM
Yes lol
Actually, dude, Python is like so easy
You should give it a shot, you will be suprised.
What gets me is the syntax for like that library
Also it's not in the documentation
So not so intelligente people like me don't get it right away XD
n

Needle

03/31/2022, 7:19 PM
Thread was archived by @アレラーノ・ケビン. Anyone can send a message to unarchive it.