Closed hunsra closed 10 months ago
Here's a screenshot of the resulting Models array from the debugger. As you can see, the first two items are in the wrong order:
I believe it's a matter of it being a comma separated query list instead of an additional order
query variable! (see here).
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:
Thanks @acupofjose.
Ah. I see. So, the query parameter needs to be formatted as a single, comma-separated list of order expressions, as in:
?order=last_name.asc.nullsfirst,first_name.asc.nullsfirst,middle_name.asc.nullsfirst
not as multiple chained query parameters, as in:
?order=last_name.asc.nullsfirst&order=first_name.asc.nullsfirst&order=middle_name.asc.nullsfirst
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.
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.