Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Sharding and query #3

Merged
merged 13 commits into from
Nov 3, 2017
Merged

Sharding and query #3

merged 13 commits into from
Nov 3, 2017

Conversation

richardschneider
Copy link
Contributor

Fixes sharding.query. All interface-datastore tests now pass.

package.json Outdated
@@ -52,6 +52,7 @@
},
"contributors": [
"David Dias <daviddias.p@gmail.com>",
"Friedel Ziegelmayer <dignifiedquire@gmail.com>"
"Friedel Ziegelmayer <dignifiedquire@gmail.com>",
"Richard Schneider <makaretu@gmail.com>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to do this manually these lists are generated on release

src/sharding.js Outdated
f(Object.assign({}, e, {
key: this._invertKey(e.key)
}), cb)
})
tq.filters.push(...filters)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... is not available in node@4, not sure if we dropped that yet, cc @diasdavid

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, will downgrade

@richardschneider
Copy link
Contributor Author

@dignifiedquire Could you look at the build? Getting errors from flow; I have no knowledge of the tool.

Good news is that lint and all tests pass.

@richardschneider
Copy link
Contributor Author

Now that we are building on windows, we need PR ipfs/interface-datastore#12.

Any idea on when it will be approved and released to NPM?

src/sharding.js Outdated
@@ -128,52 +127,45 @@ class ShardingDatastore {
}

query (q /* : Query<Buffer> */) /* : QueryResult<Buffer> */ {
const tq/* : Query<Buffer> */ = {
keysOnly: q.keysOnly
let tq/* : Query<Buffer> */ = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/let/const/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit old-school, I use const when the object won't change; which is the JS usage..

src/sharding.js Outdated
}

if (q.filters != null) {
tq.filters = q.filters.map((f) => (e, cb) => {
let filters = q.filters.map((f) => (e, cb) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/let/const/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got me, consistency is the hobglobin of little minds!

I'll make both changes

@daviddias daviddias changed the base branch from master to windows-interop November 3, 2017 09:14
@daviddias daviddias merged commit 6537423 into ipfs:windows-interop Nov 3, 2017
@richardschneider richardschneider deleted the shard-query branch November 3, 2017 09:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants