Skip to content

Commit

Permalink
feat!: simplify store interface, move query/batch to datastore, add g…
Browse files Browse the repository at this point in the history
…etAll to blockstore (#189)

- Removes open/close from store as not every implementation needs them
- Removes query from store as it doesn't make sense for blockstores
- Removes batch from store as storing blocks in memory before writing is a bad idea
- Adds query/batch to datastore interface
- Adds getAll to blockstore interface
- Converts datastore tests to typescript
- Improves typing of datastore/blockstore tests to allow setup/teardown to recieve the right store type to open/close, etc
- Blockstore pair is now `{ cid, block }` instead of `{ key, value }`

BREAKING CHANGE: open/close/batch/query methods have been removed from store interface, query/batch added to datastore, getAll added to blockstore
  • Loading branch information
achingbrain authored Mar 13, 2023
1 parent 54f3eee commit 0b8f1a0
Show file tree
Hide file tree
Showing 9 changed files with 279 additions and 762 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
node_modules
build
dist
.docs
.coverage
node_modules
package-lock.json
yarn.lock
.vscode
17 changes: 0 additions & 17 deletions packages/interface-blockstore-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,6 @@
},
"type": "module",
"types": "./dist/src/index.d.ts",
"typesVersions": {
"*": {
"*": [
"*",
"dist/*",
"dist/src/*",
"dist/src/*/index"
],
"src/*": [
"*",
"dist/*",
"dist/src/*",
"dist/src/*/index"
]
}
},
"files": [
"src",
"dist",
Expand Down Expand Up @@ -154,7 +138,6 @@
"interface-blockstore": "^4.0.0",
"it-all": "^2.0.0",
"it-drain": "^2.0.0",
"it-length": "^2.0.0",
"multiformats": "^11.0.0",
"uint8arrays": "^4.0.2"
},
Expand Down
Loading

0 comments on commit 0b8f1a0

Please sign in to comment.