-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sanitize_param() not correctly resolving when using nested columns #189
Comments
Is there a reason to sanitize the column at all? In the postgrest-js client all we do is remove whitespaces. |
Column names can contain postgrest special characters which need to be escaped. The js client errors out because of this; see supabase/postgrest-js#262 Are you sure you are on the latest version though? The code in that screenshot doesn't look like it is from the latest version |
I'm fine with escaping ',:()', but escaping '.' results in a wrong behaviour which makes it impossible to filter on foreign columns. eq('table_a.table_b.id', my_id) will currently resolve to "table_a.table_b.id", but should resolve to "table_a"."table_b"."id". This is using supabase-py 0.5.5 and postgrest-py 0.10.2 |
Yeah I get what you mean 👍🏼 this'll be fixed in the next release. Thanks for the report! |
Moving to the postgrest-py repo |
Fixed by #222 |
Describe the bug
When filtering for a nested column, sanitize_param is adding unneccessary " "
To Reproduce
supabase.table('character_inventory').select('character(*), slot, item(*, template(*))').eq('character.user_id', user_id).execute()
resolves to:
/rest/v1/character_inventory?select=character(*),+slot,+item(*,+template(*))&"character.user_id"=eq.2731f9cc-17f4-42a2-839a-d25dfe8d90a8
returns HTTP 400Expected behavior
Should resolve to:
/rest/v1/character_inventory?select=character(*),+slot,+item(*,+template(*))&character.user_id=eq.2731f9cc-17f4-42a2-839a-d25dfe8d90a8
returns HTTP 200Screenshots
Desktop:
The text was updated successfully, but these errors were encountered: