Skip to content

Commit a6641f8

Browse files
committed
docs: Add concurrency utilities to README quick start example
1 parent 28f1a14 commit a6641f8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ const { node, created } = db.mergeNode('Company',
6868
{ name: 'TechCorp' }, // Match criteria
6969
{ industry: 'SaaS', size: 'Large' } // Properties to set
7070
);
71+
72+
// Production concurrency (optional)
73+
import { enableWAL, withRetry, WriteQueue } from 'sqlite-graph';
74+
75+
enableWAL(db); // Better read concurrency
76+
77+
await withRetry(() => db.createNode('Job', { title: 'Engineer' })); // Auto-retry on locks
78+
79+
const writeQueue = new WriteQueue();
80+
await writeQueue.enqueue(() => db.mergeNode(...)); // Serialize writes
7181
```
7282

7383
## Installation

0 commit comments

Comments
 (0)