This repository has been archived by the owner on Sep 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
feat: split .query into .query and .queryKeys #87
Merged
achingbrain
merged 6 commits into
master
from
feat/split-query-into-query-and-query-keys
Apr 15, 2021
Merged
feat: split .query into .query and .queryKeys #87
achingbrain
merged 6 commits into
master
from
feat/split-query-into-query-and-query-keys
Apr 15, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The return type of the `.query` function varies depending on whether `keysOnly` is passed as part of the query params. This makes mapping the return type difficult as it's dependent on the function input. Here we: 1. Constrain the return type of `.query` to just key/value pairs 1. Add a new `.queryKeys` method that returns only keys 1. Add the implementation in the adapter to just chain to the existing `.query` method and map the result 1. Remove redundant utils 1. Remove redundant TextEncoder/Decoder exports 1. Change the query sort method to be a regular js sort function
vasco-santos
approved these changes
Apr 15, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Two nits in the review to consider
} | ||
|
||
/** | ||
* @param {KeyQuery} q |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not simply using the Query type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query
defines the Filter/Sort functions which use Pair
/s as arguments and/or return types. I thought about using generics to define the arg/return types of those methods but it seemed more straightforward to just have another type.
Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
achingbrain
added a commit
to ipfs/js-datastore-core
that referenced
this pull request
Apr 15, 2021
Applies changes from ipfs/interface-datastore/pull/87 and removes redundant utilities.
1 task
achingbrain
added a commit
to ipfs/js-datastore-level
that referenced
this pull request
Apr 15, 2021
Applies changes from ipfs/interface-datastore/pull/87 Depends on: - [ ] ipfs/interface-datastore#87 - [ ] ipfs/js-datastore-core#59
2 tasks
achingbrain
added a commit
to ipfs/js-datastore-fs
that referenced
this pull request
Apr 15, 2021
Applies changes from ipfs/interface-datastore/pull/87 Depends on: - [ ] ipfs/interface-datastore#87 - [ ] ipfs/js-datastore-core#59
2 tasks
achingbrain
added a commit
to ipfs/js-datastore-s3
that referenced
this pull request
Apr 15, 2021
Applies changes from ipfs/interface-datastore/pull/87 Depends on: - [ ] ipfs/interface-datastore#87 - [ ] ipfs/js-datastore-core#59
2 tasks
achingbrain
added a commit
to ipfs/js-datastore-core
that referenced
this pull request
Apr 15, 2021
Applies changes from ipfs/interface-datastore/pull/87 and removes redundant utilities.
achingbrain
added a commit
to ipfs/js-datastore-level
that referenced
this pull request
Apr 15, 2021
Applies changes from ipfs/interface-datastore/pull/87
achingbrain
added a commit
to ipfs/js-datastore-fs
that referenced
this pull request
Apr 15, 2021
Applies changes from ipfs/interface-datastore/pull/87
jacobheun
pushed a commit
to ipfs/js-datastore-s3
that referenced
this pull request
Apr 15, 2021
* feat: split .query into .query and .queryKeys Applies changes from ipfs/interface-datastore/pull/87 Depends on: - [ ] ipfs/interface-datastore#87 - [ ] ipfs/js-datastore-core#59 * chore: remove gh urls
77 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The return type of the
.query
function varies depending on whetherkeysOnly
is passed as part of the query params. This makes mappingthe return type difficult as it's dependent on the function input.
Here we:
.query
to just key/value pairs.queryKeys
method that returns only keys.query
method and map the result