-
Notifications
You must be signed in to change notification settings - Fork 30
Using multiple .Order()
methods when querying doesn't work as expected.
#85
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
Comments
I believe it's a matter of it being a comma separated query list instead of an additional If you want to do a PR, that'd be awesome! Otherwise I'll get to it when I can. The relevant code should be around here in Table.cs: postgrest-csharp/Postgrest/Table.cs Lines 658 to 667 in 20240e6
|
Thanks @acupofjose. Ah. I see. So, the query parameter needs to be formatted as a single, comma-separated list of order expressions, as in:
not as multiple chained query parameters, as in:
I'll try to see if I can make a PR to address it, but I can't promise anything as I've never made any edits to this codebase. Fingers crossed. |
You’ve got it! That’s the necessary change. Like I said, the PR is appreciated (we love new contributors) but if you can wait, I’m happy to get to it myself. |
Understood, thanks. Since I'm using the project, I'd like to be able to contribute. I'll give it a shot and make a PR if I can get it working. |
….GenerateUrl() to produce a single order query parameter with comma-separated expressions for each chained .Order() method rather than producing a separate order query parameter for each.
Bug report
Describe the bug
Using more than one
.Order()
method in a query doesn't seem to work. Only the first.Order()
method is honored.To Reproduce
Given a model with the following structure (and a corresponding table in a Supabase project):
Making the following query:
Results in a list of Contact models that are only ordered by the
"last_name"
column.Expected behavior
The resulting list should be ordered by the
"last_name"
column, then by the"first_name"
column, then by the"middle_name"
column.Screenshots
The Supabase Edge API Network Log seems to indicate the proper
?order=
query parameter is being created, but it is not returning records int he correct order, as described above:System information
Additional context
This is happening in a .NET MAUI application targeting iOS, Android, Windows, and Mac Catalyst.
The text was updated successfully, but these errors were encountered: