Skip to content

Commit

Permalink
fix application or ordering for interface change
Browse files Browse the repository at this point in the history
ipfs/go-datastore#110

Also, replace #22.
  • Loading branch information
Stebalien committed Jan 24, 2019
1 parent 8b35261 commit 12bf6c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,13 @@ func (a *accessor) queryOrig(q dsq.Query) (dsq.Results, error) {
for _, f := range q.Filters {
qr = dsq.NaiveFilter(qr, f)
}
for _, o := range q.Orders {
qr = dsq.NaiveOrder(qr, o)
if len(q.Orders) > 0 {
switch q.Orders[0].(type) {
case dsq.OrderByKey, *dsq.OrderByKey:
// Default ordering
default:
qr = dsq.NaiveOrder(qr, q.Orders...)
}
}
return qr, nil
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
},
{
"author": "jbenet",
"hash": "Qmf4xQhNomPNhrtZc67qSnfJSjxjXs9LWvknJtSXwimPrM",
"hash": "QmPGYyi1DtuWyUkG3PtvLz1xb4ScjnUvwJMCoX3cxeyxNr",
"name": "go-datastore",
"version": "3.4.1"
"version": "3.5.0"
}
],
"gxVersion": "0.8.0",
Expand Down

0 comments on commit 12bf6c8

Please sign in to comment.