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

Anoushk

01/01/2022, 2:04 PM
query issue python
Copy code
supabase.table('users').insert({"dao":str(member.guild.id),"username":str(member.name),"user_id":str(member.id)}).execute()
                         print(data3)
this is the insert qery
Copy code
({'message': 'column users.uid does not exist', 'code': '42703', 'hint': 'Perhaps you meant to reference the column "users.id".', 'details': None}, None)
this is response, weird thing is im calling user_id not uid idk why its refrencing that
@User
users table^
j

J0

01/01/2022, 2:05 PM
Thanks! Will take a look in 5 minutes
a

Anoushk

01/01/2022, 2:07 PM
@User
cool
u

! Class self.PythonAddict = True

01/01/2022, 2:09 PM
yes?
a

Anoushk

01/01/2022, 2:09 PM
cn u take a look at the above issue?
?
j

J0

01/01/2022, 2:27 PM
Looking
Could you show us the full stacktrace?
Also, what is the type of the user_id column?
a

Anoushk

01/01/2022, 4:58 PM
text
also the users table has a column dao that has foreign key to daos.uid
manually adding data thru the dashboard works
j

J0

01/02/2022, 7:24 AM
Hmm that's interesting. Thinking about how best to replicate this on my end
a

Anoushk

01/02/2022, 7:24 AM
i cud give you access to my repl
so u cn try it there
j

J0

01/02/2022, 7:25 AM
Sure, could you give me 10 minutes though? Trying to finish up parts of a django library
a

Anoushk

01/02/2022, 7:26 AM
ohk but probably wont be able to reply much
u cn copy the code into another file and try it
k

ktosiek

01/02/2022, 10:07 AM
Do you have any RLS or triggers on the users table?
Maybe there's more details in the database logs? It looks like something is mixing up your public.users table with the predefined auth.users
a

Anoushk

01/02/2022, 11:41 AM
idk what triggers are and rls is disable
j

J0

01/02/2022, 12:09 PM
Hmm yeah do you mind pasting the relevant section of the database logs, or the stacktrace of the error?
a

Anoushk

01/02/2022, 12:11 PM
i cn but i cudnt figure out what part of the logs to look at cud u give me a query?
@User ^
j

J0

01/02/2022, 12:16 PM
cool, thanks!
sorry, I'm not too sure about this one. Might not be a python lib issue per se @User @User @User wondering if y'all have any thoughts on this?
d

dreinon

01/02/2022, 1:07 PM
Might it be because there is a users table in the auth schema?
j

J0

01/02/2022, 1:09 PM
Tagging someone from JS land too to see if they have any thoughts: @User
a

anand

01/02/2022, 1:16 PM
Ah I think I know what the bug is
So when we construct a query we update
session.params
to include filters and the such
But when we
.execute
them, we don't clear the old params out
So in the next query, the params from the previous query are also sent
Copy code
py
In [12]: client.from_("test").select("*").execute()
Out[12]:
([{'id': 7,
   'created_at': '2021-10-02T16:20:51+00:00',
   'names': 'Abcdef',
   'roll_numbers': '10115'}, ...
Copy code
py
In [14]: client.from_("test").select("*").eq("non-existing-col", "1").execute()  # errors out as expected
Out[14]:
({'message': 'column test.non-existing-col does not exist',
  'code': '42703',
  'hint': None,
  'details': None},
 None)
In [15]: client.from_("test").select("*").eq("id", "1").execute() # SHOULDN'T error, but...
Out[15]:
({'message': 'column test.non-existing-col does not exist',
  'code': '42703',
  'hint': None,
  'details': None},
 None)
j

J0

01/02/2022, 1:18 PM
Auth.users schema, it's a bit hard to read
ahh that makes sense
a

anand

01/02/2022, 1:20 PM
I know because I noticed the same bug in my fork 😛

https://anand2312.tech/img/uploads/firefox_AkmPmFJjHk.png

have to dig through the API logs to catch it
a

Anoushk

01/02/2022, 1:26 PM
Ok so another bug😅
What do I do now?
Any temporary fix ?
d

dreinon

01/02/2022, 2:13 PM
It's normal there are bugs, since we are in a public alpha status
We'll work on it and publish a version w the solution since it's an important bug
a

Anoushk

01/02/2022, 2:22 PM
Yea I understand that’s completely ok
Any tentative date on when the fix can be published?
j

J0

01/02/2022, 2:24 PM
Hmm I can look into a fix about 25 hours from now but maybe the team might be able to get to it sooner if they're free
Yeah sorry about the bugs, we're still in alpha unfortunately 😅 and thank you for taking the time to report your issues! It will go a long way towards improving the eventual user experience
a

Anoushk

01/02/2022, 2:26 PM
I think it’s best if I write the whole script again in js
😅
d

dreinon

01/02/2022, 4:18 PM
if you need it urgently, I would recommend you do it
the js client is more mature
a

Anoushk

01/03/2022, 7:30 AM
Oh nice so it’s fixed
@leynier you’re a rock star man 🚀
@User is the previous bug of match func fixed, cos for this ill hv to update to latest version
j

J0

01/03/2022, 11:27 AM
yep match is available in v0.1.1, are you still facing issues with the
match
command?
a

Anoushk

01/03/2022, 11:56 AM
no i was asking so i can decide whether to update
l

leynier

01/03/2022, 3:08 PM
In v0.1.1 😅 no v1.0.1
And v0.2.0 fix this bug
j

J0

01/03/2022, 3:09 PM
v0.2.0* yes leynier is right