Skip to content
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

Allows custom sorting for termine yarpnarap #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fgrsnau
Copy link

@fgrsnau fgrsnau commented Nov 16, 2019

This PR changes the code to let the PostgreSQL database do the sorting.

@Merovius
Copy link
Contributor

Personally, I'd prefer to implement the different sorting strategies in Go code, instead of assembling postgres queries. It would lead to (IMO) more readable code. Here's an example of how that could be done in Go: https://play.golang.org/p/Cjj-K_rDkAF

@Merovius
Copy link
Contributor

Merovius commented Nov 16, 2019

(or alternatively, using sort.Slice: https://play.golang.org/p/XObO1DViuLm)

(or, yet another way: https://play.golang.org/p/w05YKxnwJfy)

There are a million ways, which one is the "nicest" is up to preference I guess :)

@fgrsnau
Copy link
Author

fgrsnau commented Nov 21, 2019

@Merovius I updated the PR to use Sort.Slice now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants