You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clients are strongly encouraged to read through the **[protocols document](https://github.com/FreeLeh/docs/blob/main/freedb/protocols.md)** to see how things work
63
-
under the hood and **the limitations**.
62
+
Clients are strongly encouraged to read through the **[protocols document](https://github.com/FreeLeh/docs/blob/main/freedb/protocols.md)** to see how things work under the hood and **the limitations**.
64
63
65
64
## Getting Started
66
65
67
66
### Installation
68
67
69
68
```
70
-
npm install jsfreedb
69
+
npm install @freeleh/jsfreedb
71
70
```
72
71
73
72
### Pre-requisites
@@ -79,6 +78,9 @@ npm install jsfreedb
79
78
80
79
Let's assume each row in the table is represented by the `Person` interface.
81
80
81
+
> Note that you can also represent the row using a normal JavaScript object.
82
+
> The object must follow the columns registered in the `store`.
If the key is not found, a `KeyNotFoundError` will be thrown.
347
-
348
-
```typescript
349
-
try {
350
-
const value =awaitkv.get("k1");
351
-
console.log(value);
352
-
} catch (error) {
353
-
if (errorinstanceofKeyNotFoundError) {
354
-
console.log("Key not found");
355
-
} else {
356
-
throwerror;
357
-
}
358
-
}
359
-
```
360
-
361
-
### Set Key V2
362
-
363
-
```typescript
364
-
awaitkv.set("k1", "some_value");
365
-
```
366
-
367
-
### Delete Key V2
368
-
369
-
```typescript
370
-
awaitkv.delete("k1");
371
-
```
372
-
373
-
### Supported Modes V2
374
-
375
-
> For more details on how the two modes are different, please read the [protocol document](https://github.com/FreeLeh/docs/blob/main/freedb/protocols.md).
376
-
377
-
There are 2 different modes supported:
378
-
379
-
1. Default mode.
380
-
2. Append only mode.
381
-
382
-
```typescript
383
-
// Default mode
384
-
const kv =awaitGoogleSheetKVStoreV2.create(
385
-
auth,
386
-
"<spreadsheet_id>",
387
-
"<sheet_name>",
388
-
{ mode: KVMode.Default }
389
-
);
390
-
391
-
// Append only mode
392
-
const kv =awaitGoogleSheetKVStoreV2.create(
393
-
auth,
394
-
"<spreadsheet_id>",
395
-
"<sheet_name>",
396
-
{ mode: KVMode.AppendOnly }
397
-
);
398
-
```
399
-
400
314
## License
401
315
402
316
This project is [MIT licensed](https://github.com/FreeLeh/JSFreeDB/blob/main/LICENSE).
0 commit comments