-
Notifications
You must be signed in to change notification settings - Fork 7
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
Sorting a field within relation #56
Comments
This is not possible cuase Maphper isn't doing SQL Joins. What you can do is use usort to sort the output with your own sorting function.
Not tested, but I think you will get the Idea. |
I wonder if it should be - or is there some advantage to not doing that? |
The reason for not doing SQL joins is that Maphper is designed to map relationships between arbitrary sources, we don't want to assume that both ends of the relationship are the same SQL database. One end could be a databse and another a CSV or JSON file. Only PDO is supported currently but you could still define a relationship between two different databases |
It would be great if it could detect when two of the same source are being used and thus make use of specific features supported by that source to accomplish relational data retrieval, which would enable things like this. I suppose the question is, what should be returned when a source-supported sort is not available? Maybe throw an error saying something like, "Sorting method not defined for the sources in use."? |
Hi,
lets have a table A which has a fk a_bId refrencing table B, B containg a field b_field
I want to retrieve all A records sorted by b_field.
$sortingString="b_field";
is not working (see $sortingString below).How may I manage it?
Thank you
The text was updated successfully, but these errors were encountered: