Skip to content

Commit 6878550

Browse files
authored
Update the SDK to be compatible with the immudb 1.0.9
Update the SDK to be compatible with the immudb 1.0.9
2 parents 6bc8076 + cc04e4f commit 6878550

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+10755
-7798
lines changed

.env renamed to .env.example

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
IMMUDB_DEV_PATH=/path/to/immudb/repo
1+
IMMUDB_DEV_PATH=/path/to/immudb/
22
IMMUDB_HOST=127.0.0.1
33
IMMUDB_PORT=3322
44
IMMUDB_TEST_PORT=56789
55
IMMUDB_USER=immudb
6-
IMMUDB_PWD=immudb
6+
IMMUDB_PWD=immudb
7+
IMMUDB_DEFAULT_DB=defaultdb

.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
node_modules
1+
node_modules/
22
package-lock.json
33
root.json
4-
test/immudb
4+
tests/immudb
55
.nyc_output
66
.vscode/
7-
test/root.json
7+
tests/root.json
88
.vscode
9-
rootfile
9+
root
10+
rootfile
11+
examples/.env
12+
.env
13+
dist/

.idea/.gitignore

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/Project.xml

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/immudb-node.iml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,22 @@ const ImmudbClient = require('immudb-node')
4949

5050
immudb-node supports the [latest immudb release].
5151

52-
[latest immudb release]: https://github.com/codenotary/immudb/releases/tag/v0.8.0
52+
[latest immudb release]: https://github.com/codenotary/immudb/releases/tag/v0.9.1
5353

5454
## Quickstart
5555

5656
Check out some [examples]
5757

5858
[examples]: https://github.com/codenotary/immudb-node/tree/master/examples/
5959

60+
## Testing
61+
62+
Create a `.env` file based on a `.env.example` in the project root and replace the `/path/to/immudb/` with your local path to immudb.
63+
64+
You can use either of the following commands to check that all the unit tests pass:
65+
- `npm run test`: _automatically_ download the [latest immudb release], run it and then run tests
66+
- `npm run test:dev`: connect to an _already running immudb_ on the `host`:`port` from the `.env` file on your machine and then run tests
67+
6068
## Step by step guide
6169

6270
### Creating a Client
@@ -150,10 +158,10 @@ read or write operation:
150158

151159
```
152160
try {
153-
let res = await cl.safeSet({ key: 'key1', value: 'value1' })
161+
let res = await cl.verifiedSet({ key: 'key1', value: 'value1' })
154162
console.log(res.index)
155163
156-
res = await cl.safeGet({ key: 'key1' })
164+
res = await cl.verifiedGet({ key: 'key1' })
157165
console.log(res.key, res.value, res.index)
158166
} catch (err) {
159167
if (err.clientErr == cl.proofErr) {
@@ -173,13 +181,13 @@ Atomic multi-key write (all entries are persisted or none):
173181
req = {
174182
keys: [{
175183
key: 'key1',
176-
payload: 'value1'
184+
value: 'value1'
177185
},{
178186
key: 'key2',
179-
payload: 'value2'
187+
value: 'value2'
180188
}]
181189
}
182-
res = await cl.setBatch(req)
190+
res = await cl.setAll(req)
183191
```
184192

185193
Atomic multi-key read (all entries are retrieved or none):
@@ -191,7 +199,7 @@ Atomic multi-key read (all entries are retrieved or none):
191199
key: 'key2',
192200
}],
193201
}
194-
res = await cl.getBatch(req)
202+
res = await cl.getAll(req)
195203
```
196204

197205
### Closing the client

0 commit comments

Comments
 (0)