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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort by primary key has no effect seemingly #139

Closed
sentriz opened this issue Mar 13, 2024 · 3 comments
Closed

Sort by primary key has no effect seemingly #139

sentriz opened this issue Mar 13, 2024 · 3 comments
Assignees
Labels

Comments

@sentriz
Copy link

sentriz commented Mar 13, 2024

hi, thanks for the great library 馃憣

i'm trying to sort by primary key, as in

type Row struct {
    ID uint64 `boltholdKey:"ID"`
}

and

var rows []*Row
db.Find(&rows, (&bolthold.Query{}).SortBy("ID").Reverse())

despite the .Reverse(), the rows will be sorted in ascending order

full reproduction: https://go.dev/play/p/WVmNyeZODCK

thanks!

@timshannon timshannon self-assigned this Mar 14, 2024
@timshannon timshannon added the bug label Mar 14, 2024
@timshannon
Copy link
Owner

Thanks for the report, definitely overlooked that since the PK is already sorted naturally, however it should absolutely handle reverse properly.

@timshannon
Copy link
Owner

Should be fixed now in master. Thanks for reporting.

@sentriz
Copy link
Author

sentriz commented Mar 14, 2024

thanks!

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

No branches or pull requests

2 participants