edinburgh 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +316 -7
- package/build/src/edinburgh.js +3 -2
- package/build/src/edinburgh.js.map +1 -1
- package/package.json +8 -7
- package/skill/SKILL.md +1349 -0
- package/src/edinburgh.ts +3 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -70,7 +70,9 @@ await E.transact(() => {
|
|
|
70
70
|
});
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
##
|
|
73
|
+
## Tutorial
|
|
74
|
+
|
|
75
|
+
### TypeScript Configuration
|
|
74
76
|
|
|
75
77
|
When using TypeScript to transpile to JavaScript, make sure to enable the following options in your `tsconfig.json`:
|
|
76
78
|
|
|
@@ -83,15 +85,322 @@ When using TypeScript to transpile to JavaScript, make sure to enable the follow
|
|
|
83
85
|
}
|
|
84
86
|
```
|
|
85
87
|
|
|
86
|
-
|
|
88
|
+
### Defining Models
|
|
89
|
+
|
|
90
|
+
Models are classes that extend `E.Model<Self>` and use the `@E.registerModel` decorator:
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import * as E from "edinburgh";
|
|
94
|
+
|
|
95
|
+
@E.registerModel
|
|
96
|
+
class User extends E.Model<User> {
|
|
97
|
+
static pk = E.primary(User, "id");
|
|
98
|
+
|
|
99
|
+
id = E.field(E.identifier);
|
|
100
|
+
name = E.field(E.string);
|
|
101
|
+
email = E.field(E.string);
|
|
102
|
+
age = E.field(E.number);
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Instance fields are declared with `E.field(type, options?)`. Available types:
|
|
107
|
+
|
|
108
|
+
| Type | TypeScript type | Notes |
|
|
109
|
+
|------|----------------|-------|
|
|
110
|
+
| `E.string` | `string` | |
|
|
111
|
+
| `E.orderedString` | `string` | Lexicographic sort in indexes; no null bytes |
|
|
112
|
+
| `E.number` | `number` | |
|
|
113
|
+
| `E.boolean` | `boolean` | |
|
|
114
|
+
| `E.dateTime` | `Date` | Defaults to `new Date()` |
|
|
115
|
+
| `E.identifier` | `string` | Auto-generated 8-char unique ID |
|
|
116
|
+
| `E.opt(T)` | `T \| undefined` | Makes any type optional |
|
|
117
|
+
| `E.or(A, B, ...)` | `A \| B \| ...` | Union type; args can be types or literal values |
|
|
118
|
+
| `E.literal(v)` | literal type | Constant value; defaults to that value |
|
|
119
|
+
| `E.array(T)` | `T[]` | Optional `{min, max}` constraints |
|
|
120
|
+
| `E.link(Model)` | `Model` | Foreign key, lazy-loaded on access |
|
|
121
|
+
|
|
122
|
+
#### Defaults
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
@E.registerModel
|
|
126
|
+
class Post extends E.Model<Post> {
|
|
127
|
+
static pk = E.primary(Post, "id");
|
|
128
|
+
|
|
129
|
+
id = E.field(E.identifier); // auto-generated
|
|
130
|
+
title = E.field(E.string);
|
|
131
|
+
status = E.field(E.or("draft", "published"), {default: "draft"});
|
|
132
|
+
tags = E.field(E.array(E.string), {default: () => []}); // use function for mutable defaults
|
|
133
|
+
createdAt = E.field(E.dateTime); // dateTime defaults to new Date()
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Transactions
|
|
138
|
+
|
|
139
|
+
All database operations must run inside `E.transact()`:
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
// Initialize (optional — defaults to ".edinburgh" directory)
|
|
143
|
+
E.init("./my-database");
|
|
144
|
+
|
|
145
|
+
// Create
|
|
146
|
+
await E.transact(() => {
|
|
147
|
+
const user = new User({name: "Alice", email: "alice@example.com", age: 30});
|
|
148
|
+
// user.id is auto-generated
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// Read + Update
|
|
152
|
+
await E.transact(() => {
|
|
153
|
+
const user = User.byEmail.get("alice@example.com");
|
|
154
|
+
if (user) user.age++;
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// Return values from transactions
|
|
158
|
+
const name = await E.transact(() => {
|
|
159
|
+
const user = User.byEmail.get("alice@example.com");
|
|
160
|
+
return user?.name;
|
|
161
|
+
});
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Transactions auto-retry on conflict (up to 6 times by default). Keep transaction functions idempotent.
|
|
165
|
+
|
|
166
|
+
### Indexes
|
|
167
|
+
|
|
168
|
+
Edinburgh supports three index types:
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
@E.registerModel
|
|
172
|
+
class Product extends E.Model<Product> {
|
|
173
|
+
static pk = E.primary(Product, "sku"); // primary: one per model, stores data
|
|
174
|
+
static byName = E.unique(Product, "name"); // unique: enforces uniqueness + fast lookup
|
|
175
|
+
static byCategory = E.index(Product, "category");// secondary: non-unique, for queries
|
|
176
|
+
|
|
177
|
+
sku = E.field(E.string);
|
|
178
|
+
name = E.field(E.string);
|
|
179
|
+
category = E.field(E.string);
|
|
180
|
+
price = E.field(E.number);
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
If no `E.primary()` is declared, Edinburgh auto-creates one on an `id` field (adding `E.identifier` if missing).
|
|
185
|
+
|
|
186
|
+
#### Lookups
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
await E.transact(() => {
|
|
190
|
+
// Primary key lookup
|
|
191
|
+
const p = Product.pk.get("SKU-001");
|
|
192
|
+
|
|
193
|
+
// Unique index lookup
|
|
194
|
+
const p2 = Product.byName.get("Widget");
|
|
195
|
+
|
|
196
|
+
// All return undefined if not found
|
|
197
|
+
});
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
#### Range Queries
|
|
201
|
+
|
|
202
|
+
All index types support `.find()` for range iteration:
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
await E.transact(() => {
|
|
206
|
+
// Exact match
|
|
207
|
+
for (const p of Product.byCategory.find({is: "electronics"})) {
|
|
208
|
+
console.log(p.name);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Range (inclusive)
|
|
212
|
+
for (const p of Product.pk.find({from: "A", to: "M"})) {
|
|
213
|
+
console.log(p.sku);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Exclusive bounds
|
|
217
|
+
for (const p of Product.pk.find({after: "A", before: "M"})) { ... }
|
|
218
|
+
|
|
219
|
+
// Open-ended
|
|
220
|
+
for (const p of Product.pk.find({from: "M"})) { ... }
|
|
221
|
+
|
|
222
|
+
// Reverse
|
|
223
|
+
for (const p of Product.pk.find({reverse: true})) { ... }
|
|
224
|
+
|
|
225
|
+
// Count and fetch helpers
|
|
226
|
+
const count = Product.byCategory.find({is: "electronics"}).count();
|
|
227
|
+
const first = Product.byCategory.find({is: "electronics"}).fetch(); // first match or undefined
|
|
228
|
+
});
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
#### Composite Indexes
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
@E.registerModel
|
|
235
|
+
class Event extends E.Model<Event> {
|
|
236
|
+
static pk = E.primary(Event, ["year", "month", "id"]);
|
|
237
|
+
|
|
238
|
+
year = E.field(E.number);
|
|
239
|
+
month = E.field(E.number);
|
|
240
|
+
id = E.field(E.identifier);
|
|
241
|
+
title = E.field(E.string);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
await E.transact(() => {
|
|
245
|
+
// Prefix matching — find all events in 2025
|
|
246
|
+
for (const e of Event.pk.find({is: [2025]})) { ... }
|
|
247
|
+
|
|
248
|
+
// Find events in March 2025
|
|
249
|
+
for (const e of Event.pk.find({is: [2025, 3]})) { ... }
|
|
250
|
+
});
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Relationships (Links)
|
|
254
|
+
|
|
255
|
+
Use `E.link(Model)` for foreign keys:
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
@E.registerModel
|
|
259
|
+
class Author extends E.Model<Author> {
|
|
260
|
+
static pk = E.primary(Author, "id");
|
|
261
|
+
id = E.field(E.identifier);
|
|
262
|
+
name = E.field(E.string);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
@E.registerModel
|
|
266
|
+
class Book extends E.Model<Book> {
|
|
267
|
+
static pk = E.primary(Book, "id");
|
|
268
|
+
id = E.field(E.identifier);
|
|
269
|
+
title = E.field(E.string);
|
|
270
|
+
author = E.field(E.link(Author));
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
await E.transact(() => {
|
|
274
|
+
const author = new Author({name: "Tolkien"});
|
|
275
|
+
const book = new Book({title: "The Hobbit", author});
|
|
276
|
+
|
|
277
|
+
// Later: linked models are lazy-loaded on property access
|
|
278
|
+
const b = Book.pk.get(book.id)!;
|
|
279
|
+
console.log(b.author.name); // loads Author automatically (~1µs)
|
|
280
|
+
});
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Deleting
|
|
284
|
+
|
|
285
|
+
```typescript
|
|
286
|
+
await E.transact(() => {
|
|
287
|
+
const user = User.pk.get(someId);
|
|
288
|
+
if (user) user.delete();
|
|
289
|
+
});
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Model Utilities
|
|
293
|
+
|
|
294
|
+
```typescript
|
|
295
|
+
await E.transact(() => {
|
|
296
|
+
const user = new User({name: "Bob", email: "bob@example.com", age: 25});
|
|
297
|
+
|
|
298
|
+
user.validate(); // returns Error[]
|
|
299
|
+
user.isValid(); // returns boolean
|
|
300
|
+
user.getState(); // "created" | "loaded" | "lazy" | "deleted"
|
|
301
|
+
user.getPrimaryKey(); // Uint8Array
|
|
302
|
+
user.preventPersist(); // exclude from commit
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// findAll iterates all instances
|
|
306
|
+
await E.transact(() => {
|
|
307
|
+
for (const user of User.findAll()) { ... }
|
|
308
|
+
for (const user of User.findAll({reverse: true})) { ... }
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
// replaceInto: upsert by primary key
|
|
312
|
+
await E.transact(() => {
|
|
313
|
+
User.replaceInto({id: existingId, name: "Updated Name", email: "new@example.com", age: 30});
|
|
314
|
+
});
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Batch Processing
|
|
318
|
+
|
|
319
|
+
For large datasets, `batchProcess` auto-commits in batches:
|
|
320
|
+
|
|
321
|
+
```typescript
|
|
322
|
+
await Product.byCategory.batchProcess({is: "old"}, (product) => {
|
|
323
|
+
product.category = "archived";
|
|
324
|
+
});
|
|
325
|
+
// Commits every ~1 second or 4096 rows (configurable via limitSeconds, limitRows)
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Schema Evolution
|
|
87
329
|
|
|
88
|
-
|
|
330
|
+
Edinburgh handles schema changes automatically:
|
|
331
|
+
|
|
332
|
+
- **Adding/removing fields**: Old rows are lazily migrated on read. New fields use their default value.
|
|
333
|
+
- **Changing field types**: Requires a `static migrate()` function.
|
|
334
|
+
- **Adding/removing indexes**: Requires running `npx migrate-edinburgh`.
|
|
335
|
+
|
|
336
|
+
```typescript
|
|
337
|
+
@E.registerModel
|
|
338
|
+
class User extends E.Model<User> {
|
|
339
|
+
static pk = E.primary(User, "id");
|
|
340
|
+
id = E.field(E.identifier);
|
|
341
|
+
name = E.field(E.string);
|
|
342
|
+
role = E.field(E.string, {default: "user"}); // new field
|
|
343
|
+
|
|
344
|
+
static migrate(record: Record<string, any>) {
|
|
345
|
+
record.role ??= "user"; // provide value for old rows
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Run `npx migrate-edinburgh` (or call `E.runMigration()`) after adding/removing indexes, changing index field types, or when a `migrate()` function affects indexed fields.
|
|
351
|
+
|
|
352
|
+
### preCommit Hook
|
|
353
|
+
|
|
354
|
+
Compute derived fields before data is written:
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
@E.registerModel
|
|
358
|
+
class Article extends E.Model<Article> {
|
|
359
|
+
static pk = E.primary(Article, "id");
|
|
360
|
+
id = E.field(E.identifier);
|
|
361
|
+
title = E.field(E.string);
|
|
362
|
+
slug = E.field(E.string);
|
|
363
|
+
|
|
364
|
+
preCommit() {
|
|
365
|
+
this.slug = this.title.toLowerCase().replace(/\s+/g, "-");
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Change Tracking
|
|
371
|
+
|
|
372
|
+
Monitor commits with `setOnSaveCallback`:
|
|
373
|
+
|
|
374
|
+
```typescript
|
|
375
|
+
E.setOnSaveCallback((commitId, items) => {
|
|
376
|
+
for (const [instance, change] of items) {
|
|
377
|
+
if (change === "created") { /* new record */ }
|
|
378
|
+
else if (change === "deleted") { /* removed */ }
|
|
379
|
+
else { /* change is an object with old values of modified fields */ }
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Logging
|
|
385
|
+
|
|
386
|
+
Enable debug logging by setting the `EDINBURGH_LOG_LEVEL` environment variable (0–3). Higher numbers produce more verbose logs.
|
|
89
387
|
|
|
90
388
|
- 0: no logging (default)
|
|
91
389
|
- 1: model-level logs
|
|
92
390
|
- 2: + update logs
|
|
93
391
|
- 3: + read logs
|
|
94
392
|
|
|
393
|
+
### AI Integration
|
|
394
|
+
|
|
395
|
+
If you use Claude Code, GitHub Copilot or another AI agent that supports Skills, Edinburgh includes a `skill/` directory in its npm package that provides specialized knowledge to the AI about how to use the library effectively.
|
|
396
|
+
|
|
397
|
+
Symlink the skill into your project's `.claude/skills` directory:
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
mkdir -p .claude/skills
|
|
401
|
+
ln -s ../../node_modules/edinburgh/skill .claude/skills/edinburgh
|
|
402
|
+
```
|
|
403
|
+
|
|
95
404
|
## API Reference
|
|
96
405
|
|
|
97
406
|
The following is auto-generated from `src/edinburgh.ts`:
|
|
@@ -219,19 +528,19 @@ class User extends E.Model<User> {
|
|
|
219
528
|
}
|
|
220
529
|
```
|
|
221
530
|
|
|
222
|
-
#### Model.tableName · [static property](https://github.com/vanviegen/edinburgh/blob/main/src/edinburgh.ts#
|
|
531
|
+
#### Model.tableName · [static property](https://github.com/vanviegen/edinburgh/blob/main/src/edinburgh.ts#L225)
|
|
223
532
|
|
|
224
533
|
The database table name (defaults to class name).
|
|
225
534
|
|
|
226
535
|
**Type:** `string`
|
|
227
536
|
|
|
228
|
-
#### Model.override · [static property](https://github.com/vanviegen/edinburgh/blob/main/src/edinburgh.ts#
|
|
537
|
+
#### Model.override · [static property](https://github.com/vanviegen/edinburgh/blob/main/src/edinburgh.ts#L229)
|
|
229
538
|
|
|
230
539
|
When true, registerModel replaces an existing model with the same tableName.
|
|
231
540
|
|
|
232
541
|
**Type:** `boolean`
|
|
233
542
|
|
|
234
|
-
#### Model.fields · [static property](https://github.com/vanviegen/edinburgh/blob/main/src/edinburgh.ts#
|
|
543
|
+
#### Model.fields · [static property](https://github.com/vanviegen/edinburgh/blob/main/src/edinburgh.ts#L230)
|
|
235
544
|
|
|
236
545
|
Field configuration metadata.
|
|
237
546
|
|
|
@@ -772,7 +1081,7 @@ This is primarily useful for development and debugging purposes.
|
|
|
772
1081
|
|
|
773
1082
|
**Signature:** `() => void`
|
|
774
1083
|
|
|
775
|
-
### BaseIndex · [abstract class](https://github.com/vanviegen/edinburgh/blob/main/src/edinburgh.ts#
|
|
1084
|
+
### BaseIndex · [abstract class](https://github.com/vanviegen/edinburgh/blob/main/src/edinburgh.ts#L127)
|
|
776
1085
|
|
|
777
1086
|
Base class for database indexes for efficient lookups on model fields.
|
|
778
1087
|
|
package/build/src/edinburgh.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as lowlevel from "olmdb/lowlevel";
|
|
2
2
|
import { init as olmdbInit, DatabaseError } from "olmdb/lowlevel";
|
|
3
3
|
import { modelRegistry, txnStorage, currentTxn } from "./models.js";
|
|
4
|
-
let initNeeded =
|
|
4
|
+
let initNeeded = true;
|
|
5
5
|
export function scheduleInit() { initNeeded = true; }
|
|
6
6
|
// Re-export public API from models
|
|
7
7
|
export { Model, registerModel, field, } from "./models.js";
|
|
@@ -90,8 +90,9 @@ export async function transact(fn) {
|
|
|
90
90
|
for (const model of Object.values(modelRegistry)) {
|
|
91
91
|
await model._delayedInit();
|
|
92
92
|
}
|
|
93
|
-
pendingInit = undefined;
|
|
94
93
|
})();
|
|
94
|
+
await pendingInit;
|
|
95
|
+
pendingInit = undefined;
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
// try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edinburgh.js","sourceRoot":"","sources":["../../src/edinburgh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEpE,IAAI,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"edinburgh.js","sourceRoot":"","sources":["../../src/edinburgh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEpE,IAAI,UAAU,GAAG,IAAI,CAAC;AACtB,MAAM,UAAU,YAAY,KAAK,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC;AAGrD,mCAAmC;AACnC,OAAO,EACH,KAAK,EACL,aAAa,EACb,KAAK,GACR,MAAM,aAAa,CAAC;AAIrB,yEAAyE;AACzE,OAAO;AACH,6BAA6B;AAC7B,MAAM,EACN,aAAa,EACb,MAAM,EACN,QAAQ,EACR,OAAO,EACP,UAAU,EACV,KAAK;AACL,yBAAyB;AACzB,GAAG,E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CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edinburgh",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"author": "Frank van Viegen",
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@types/bun": "^1.2.16",
|
|
7
7
|
"@types/node": "^22.10.6",
|
|
8
|
+
"readme-tsdoc": "^1.1.4",
|
|
8
9
|
"typescript": "^5.8.3",
|
|
9
|
-
"vitest": "^3.2.4"
|
|
10
|
-
"readme-tsdoc": "^1.1.4"
|
|
10
|
+
"vitest": "^3.2.4"
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"src",
|
|
30
|
-
"build/src"
|
|
30
|
+
"build/src",
|
|
31
|
+
"skill"
|
|
31
32
|
],
|
|
32
33
|
"keywords": [
|
|
33
34
|
"orm",
|
|
@@ -41,13 +42,13 @@
|
|
|
41
42
|
],
|
|
42
43
|
"license": "ISC",
|
|
43
44
|
"scripts": {
|
|
44
|
-
"build": "rm -rf build && tsc",
|
|
45
|
+
"build": "rm -rf build skill && tsc && bun run build:docs",
|
|
45
46
|
"test": "npm run test:bun && npm run test:node",
|
|
46
47
|
"test:watch": "bun x vitest --bail 1 --watch --silent=passed-only",
|
|
47
48
|
"test:bun": "bun test --bail",
|
|
48
49
|
"test:node": "bun x vitest --bail 1 --watch=false --silent=passed-only",
|
|
49
|
-
"prepack": "npm run build && npm run test && npm run
|
|
50
|
-
"
|
|
50
|
+
"prepack": "npm run build && npm run test && npm run build:docs",
|
|
51
|
+
"build:docs": "readme-tsdoc && mkdir -p skill && cat skill-header.md README.md > skill/SKILL.md && readme-tsdoc --repo-url https://github.com/vanviegen/edinburgh"
|
|
51
52
|
},
|
|
52
53
|
"trustedDependencies": [
|
|
53
54
|
"olmdb"
|