@slimr/dbsync 0.0.15 → 0.0.17
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/README.md +185 -134
- package/cjs/DbRepository.d.ts +1 -1
- package/cjs/DbRepository.js +1 -1
- package/cjs/DbRepository.js.map +1 -1
- package/cjs/DbSync.d.ts +1 -1
- package/cjs/DbSync.js +1 -1
- package/cjs/DbSync.js.map +1 -1
- package/esm/DbRepository.d.ts +1 -1
- package/esm/DbRepository.js +1 -1
- package/esm/DbRepository.js.map +1 -1
- package/esm/DbSync.d.ts +1 -1
- package/esm/DbSync.js +1 -1
- package/esm/DbSync.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,19 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
A powerfully slim, offline-first IndexedDB ORM and sync engine.
|
|
4
4
|
|
|
5
|
-
`@slimr/dbsync`
|
|
5
|
+
`@slimr/dbsync` is for browser apps that need instant local UX without giving up a real backend. You write against a small Promise-based IndexedDB API; `dbsync` handles the parts that usually make offline-first architecture painful: durable local mutation queues, background replay, cross-tab updates, schema drift, auth-aware resets, and remote synchronization.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
If your app should still feel fast on weak or flaky networks, `dbsync` lets you keep the user experience local-first while still syncing to a remote source of truth.
|
|
8
|
+
|
|
9
|
+
## Why library consumers like it
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
- ⚡️ **Reads and writes stay fast:** IndexedDB is the primary runtime data layer, so your UI is not blocked on the network.
|
|
12
|
+
- 🔄 **Offline is not a separate mode:** the same CRUD API works whether the browser is online, offline, or moving in and out of connectivity.
|
|
13
|
+
- 🌐 **You keep your backend:** byo REST backend, or use our pre-made Swift backend.
|
|
14
|
+
- 📣 **Your app stays coherent across tabs:** local changes and synced changes are broadcast through the same subscription model.
|
|
15
|
+
- 🧠 **The surface area stays small:** you get full-featured offline-first behavior fairly low complexity.
|
|
16
|
+
- 🌱 **Zero runtime dependencies:** built on standard web APIs like IndexedDB, BroadcastChannel, Web Locks, and `fetch`.
|
|
10
17
|
|
|
11
|
-
##
|
|
18
|
+
## The hard problems it solves for you
|
|
12
19
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
20
|
+
- **Durable offline writes:** `put`, `add`, `patch`, and `delete` happen locally first, then flow into internal dirty and deleted queues for later push.
|
|
21
|
+
- **Cross-tab coordination:** `BroadcastChannel` fans out updates so other tabs can react without manual cache invalidation.
|
|
22
|
+
- **Leader election for sync:** when Web Locks are available, only one tab polls and pushes at a time.
|
|
23
|
+
- **Schema drift across devices:** table definitions are converted into a deterministic schema signature, or you can provide an explicit version number.
|
|
24
|
+
- **Safe data evolution:** `defaultSetter`, `applyDefaults()`, and migrations help normalize old and new records as your model changes.
|
|
25
|
+
- **Auth-aware local state:** auth failures stop syncing, and `reset()` can wipe local IndexedDB state when the session ends.
|
|
18
26
|
|
|
19
27
|
## Installation
|
|
20
28
|
|
|
@@ -23,132 +31,90 @@ npm install @slimr/dbsync
|
|
|
23
31
|
```
|
|
24
32
|
|
|
25
33
|
## Quick Start
|
|
26
|
-
|
|
34
|
+
|
|
35
|
+
Create a `DbSync` instance with an [adapter](./docs/Adapters.md) and your table definitions, then call `start()`. That initializes IndexedDB if needed and starts background sync.
|
|
27
36
|
|
|
28
37
|
```typescript
|
|
29
38
|
import { DbSync } from '@slimr/dbsync';
|
|
30
39
|
import { LocalAdapter, RestAdapter } from '@slimr/dbsync/adapters';
|
|
31
40
|
|
|
32
|
-
const
|
|
41
|
+
const adapter = new RestAdapter({ url: 'https://api.myapp.com' });
|
|
42
|
+
// For local-only apps or tests:
|
|
43
|
+
// const adapter = new LocalAdapter();
|
|
33
44
|
|
|
34
45
|
const db = new DbSync({
|
|
35
|
-
adapter
|
|
46
|
+
adapter,
|
|
36
47
|
tables: {
|
|
37
|
-
posts: {
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
posts: {
|
|
49
|
+
indexes: ['userId', 'updatedAt'],
|
|
50
|
+
defaultSetter: (post) => ({
|
|
51
|
+
category: 0,
|
|
52
|
+
updatedAt: Date.now(),
|
|
53
|
+
...post,
|
|
54
|
+
}),
|
|
55
|
+
},
|
|
56
|
+
users: {
|
|
57
|
+
indexes: ['email'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
40
60
|
});
|
|
41
61
|
|
|
42
|
-
// Init the db and boot up the background sync engine!
|
|
43
62
|
await db.start();
|
|
44
63
|
```
|
|
45
64
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## Schema Versioning
|
|
49
|
-
|
|
50
|
-
`@slimr/dbsync` automatically manages your IndexedDB database versioning to prevent schema mismatches and corruption across tabs and devices.
|
|
51
|
-
|
|
52
|
-
By default, you don't even need to provide a `version`. The library calculates a **deterministic schema signature** based on the tables and indexes you define in `tables`. If you modify your schema, the signature changes, the local IndexedDB version is automatically incremented, and this schema change is announced to the backend. Other tabs and devices syncing from the server will detect the new signature and safely reload to adapt to the new schema without mutating data out-of-bounds.
|
|
53
|
-
|
|
54
|
-
If you prefer explicit control, you can provide an exact `version: number` in the config. `@slimr/dbsync` will strictly enforce that exact version across the network instead.
|
|
55
|
-
|
|
56
|
-
### Defaulting Hooks
|
|
57
|
-
Sometimes you want to ensure default values or dynamic fields are applied before any `add` or `put` operation. By providing a `defaultSetter` function in your `DbSyncTableConfig`, you can modify or validate the payload immediately before it is written to the queue, ensuring all subsequent hooks and backend tables receive consistent data.
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
const db = new DbSync({
|
|
61
|
-
adapter: dbAdapter,
|
|
62
|
-
tables: {
|
|
63
|
-
posts: {
|
|
64
|
-
defaultSetter: (val) => ({ ...val, updatedAt: Date.now() })
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
You can access this function later also for convenience on `DbSync` and `DbRepository`
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
const normalizedPost = await db.applyDefaults('posts', { title: 'draft' });
|
|
74
|
-
|
|
75
|
-
const postsRepo = new DbRepository<Post>(db, 'posts');
|
|
76
|
-
const normalizedViaRepo = await postsRepo.applyDefaults({ title: 'draft' });
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Schema Data Migrations
|
|
80
|
-
As your app grows, document structures will evolve. `@slimr/dbsync` provides a graceful mechanism for applying sequential, in-place schema rewrites to persistent data immediately after IndexedDB initialization. This ensures long-lived cached objects automatically adapt to your new models.
|
|
81
|
-
|
|
82
|
-
Simply supply a `migrations` array onto your `DbSyncTableConfig`. `@slimr/dbsync` iterates through the existing records, applies the logic cleanly, and commits the updated schema to the database. A record currently at `version: 1` will only trigger migrations where `version >= 2`.
|
|
83
|
-
|
|
84
|
-
```typescript
|
|
85
|
-
import { DbSync, type Migration } from '@slimr/dbsync';
|
|
86
|
-
|
|
87
|
-
const userMigrations: Migration[] = [
|
|
88
|
-
{
|
|
89
|
-
version: 2,
|
|
90
|
-
note: 'Merge firstName and lastName into fullName',
|
|
91
|
-
upgrade: async (record) => {
|
|
92
|
-
record.fullName = `${record.firstName} ${record.lastName}`.trim();
|
|
93
|
-
delete record.firstName;
|
|
94
|
-
delete record.lastName;
|
|
95
|
-
// The record is updated in place
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
];
|
|
65
|
+
### What `start()` actually does
|
|
99
66
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
migrations: userMigrations
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
});
|
|
67
|
+
- Opens and upgrades your IndexedDB stores.
|
|
68
|
+
- Runs configured record migrations.
|
|
69
|
+
- Starts the background pull/push loop.
|
|
70
|
+
- Lets one tab become the sync leader while the rest stay passive.
|
|
108
71
|
|
|
109
|
-
|
|
110
|
-
```
|
|
72
|
+
> If you want all the local ORM and reactivity features without any remote system, use `LocalAdapter`. Your app keeps the same API, just without a real backend handshake.
|
|
111
73
|
|
|
112
|
-
|
|
74
|
+
## The local-first API
|
|
113
75
|
|
|
114
|
-
|
|
115
|
-
Once initialized, `dbsync` acts as a fast NoSQL document store. To support offline-first behavior, you should generate IDs locally using `db.uuid()`.
|
|
76
|
+
Once started, `dbsync` behaves like a small object-store ORM for your browser app. The important difference is that writes also participate in background synchronization.
|
|
116
77
|
|
|
117
78
|
### Basic CRUD
|
|
79
|
+
|
|
118
80
|
```typescript
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
content: 'Hello
|
|
123
|
-
userId: 'user_123'
|
|
81
|
+
const newPost = await db.put('posts', {
|
|
82
|
+
id: db.genUuid(),
|
|
83
|
+
userId: 'user_123',
|
|
84
|
+
content: 'Hello world',
|
|
124
85
|
});
|
|
125
86
|
|
|
126
|
-
// Read
|
|
127
87
|
const myPost = await db.get('posts', newPost.id);
|
|
128
88
|
const allPosts = await db.findAll('posts');
|
|
129
89
|
|
|
130
|
-
|
|
90
|
+
await db.patch('posts', { id: newPost.id, content: 'Edited content' });
|
|
131
91
|
await db.delete('posts', newPost.id);
|
|
132
92
|
```
|
|
133
93
|
|
|
94
|
+
### Typed repositories with less repetition
|
|
134
95
|
|
|
135
|
-
|
|
136
|
-
For a cleaner developer experience, you can wrap a table in a `DbRepository`. This automatically binds the table name and TypeScript generic to the CRUD methods so you don't have to repeat them everywhere.
|
|
96
|
+
If you do not want to keep passing store names around, wrap a table in `DbRepository` and let TypeScript carry the type information for you.
|
|
137
97
|
|
|
138
98
|
```typescript
|
|
139
99
|
import { DbRepository } from '@slimr/dbsync';
|
|
140
100
|
|
|
141
|
-
interface Post {
|
|
101
|
+
interface Post {
|
|
102
|
+
id: string;
|
|
103
|
+
userId: string;
|
|
104
|
+
content: string;
|
|
105
|
+
updatedAt?: number;
|
|
106
|
+
}
|
|
107
|
+
|
|
142
108
|
const postsRepo = new DbRepository<Post>(db, 'posts');
|
|
143
109
|
|
|
144
|
-
|
|
145
|
-
await postsRepo.put({ id: '1', content: 'Cleaner code!' });
|
|
110
|
+
await postsRepo.put({ id: '1', userId: 'u1', content: 'Cleaner code' });
|
|
146
111
|
const post = await postsRepo.findById('1');
|
|
112
|
+
const posts = await postsRepo.findAll();
|
|
147
113
|
```
|
|
148
114
|
|
|
149
|
-
### Atomic
|
|
150
|
-
|
|
151
|
-
|
|
115
|
+
### Atomic local transactions
|
|
116
|
+
|
|
117
|
+
`DbSync` transactions are buffered in memory and only hit IndexedDB when you call `commit()`. That keeps batched writes ergonomic and avoids IndexedDB's awkward async transaction timing.
|
|
152
118
|
|
|
153
119
|
```typescript
|
|
154
120
|
const tx = db.getTransaction();
|
|
@@ -158,67 +124,61 @@ tx.put('posts', { id: '2', content: 'Atomic write 2' });
|
|
|
158
124
|
tx.patch('posts', { id: '2', content: 'Atomic write 2b' });
|
|
159
125
|
tx.delete('users', 'bad_user');
|
|
160
126
|
|
|
161
|
-
// Writes hit the database together
|
|
162
127
|
await tx.commit();
|
|
163
128
|
```
|
|
164
129
|
|
|
165
|
-
|
|
130
|
+
If you want the same typed experience inside transactions, use `DbTxRepository`.
|
|
166
131
|
|
|
167
132
|
```typescript
|
|
168
133
|
import { DbTxRepository } from '@slimr/dbsync';
|
|
169
134
|
|
|
135
|
+
interface User {
|
|
136
|
+
id: string;
|
|
137
|
+
email: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
170
140
|
class Tx {
|
|
171
141
|
private tx = db.getTransaction();
|
|
172
142
|
|
|
173
|
-
// Wrap your tables for strict typings & intellisense
|
|
174
143
|
posts = new DbTxRepository<Post>(this.tx, 'posts');
|
|
175
144
|
users = new DbTxRepository<User>(this.tx, 'users');
|
|
176
145
|
|
|
177
146
|
commit = this.tx.commit.bind(this.tx);
|
|
178
147
|
}
|
|
148
|
+
```
|
|
179
149
|
|
|
180
|
-
|
|
181
|
-
tx.posts.put({ id: '1', content: 'Atomic write 1' });
|
|
182
|
-
tx.posts.put({ id: '2', content: 'Atomic write 2' });
|
|
183
|
-
tx.posts.patch({ id: '2', content: 'Atomic write 2b' });
|
|
184
|
-
tx.users.delete('bad_user');
|
|
150
|
+
## Reactivity built in
|
|
185
151
|
|
|
186
|
-
|
|
187
|
-
await tx.commit();
|
|
188
|
-
```
|
|
152
|
+
`dbsync` already knows when data changes locally, from another tab, or from the sync engine. Consumers can subscribe directly or use the React hook.
|
|
189
153
|
|
|
190
|
-
### UI
|
|
191
|
-
Whenever a table is modified—whether by you manually, or by a background Sync Engine pull—`dbsync` announces the change.
|
|
154
|
+
### Pub/sub for any UI layer
|
|
192
155
|
|
|
193
156
|
```typescript
|
|
194
157
|
const sub = db.subscribe((updatedStores) => {
|
|
195
158
|
if (updatedStores.includes('posts')) {
|
|
196
|
-
console.log('
|
|
197
|
-
// Trigger your React state re-render here
|
|
159
|
+
console.log('Posts changed');
|
|
198
160
|
}
|
|
199
161
|
});
|
|
200
162
|
|
|
201
|
-
// Clean up on component unmount
|
|
202
163
|
sub.close();
|
|
203
164
|
```
|
|
204
165
|
|
|
205
|
-
### React
|
|
206
|
-
For React users, `@slimr/dbsync` exports a built-in `useDbQuery` hook that makes binding components to your data effortless. It executes your query natively and instantly re-renders the component whenever the underlying table changes locally or remotely!
|
|
166
|
+
### React hook: `useDbQuery`
|
|
207
167
|
|
|
208
168
|
```tsx
|
|
209
169
|
import { useDbQuery } from '@slimr/dbsync/react';
|
|
210
170
|
|
|
211
171
|
function PostList({ db }) {
|
|
212
|
-
// Re-renders automatically whenever the 'posts' table changes!
|
|
213
172
|
const { value: posts, loading } = useDbQuery(db, 'posts', () => db.findAll('posts'));
|
|
214
173
|
|
|
215
|
-
if (loading) return <
|
|
174
|
+
if (loading) return <p>Loading...</p>;
|
|
216
175
|
if (!posts) return <p>No posts found.</p>;
|
|
217
|
-
|
|
176
|
+
|
|
177
|
+
return <ul>{posts.map((post) => <li key={post.id}>{post.content}</li>)}</ul>;
|
|
218
178
|
}
|
|
219
179
|
```
|
|
220
180
|
|
|
221
|
-
If you
|
|
181
|
+
If you prefer not to thread the `db` instance through every component, `@slimr/dbsync/react` also exports `createUseDbQuery`.
|
|
222
182
|
|
|
223
183
|
```tsx
|
|
224
184
|
import { createUseDbQuery } from '@slimr/dbsync/react';
|
|
@@ -226,37 +186,128 @@ import { createUseDbQuery } from '@slimr/dbsync/react';
|
|
|
226
186
|
const useDbQuery = createUseDbQuery(db);
|
|
227
187
|
|
|
228
188
|
function TodoList() {
|
|
229
|
-
const { value: todos, loading } = useDbQuery('todos', () =>
|
|
189
|
+
const { value: todos, loading } = useDbQuery('todos', () => db.findAll('todos'));
|
|
230
190
|
|
|
231
|
-
if (loading) return <
|
|
191
|
+
if (loading) return <p>Loading...</p>;
|
|
232
192
|
if (!todos) return <p>No todos found.</p>;
|
|
233
|
-
|
|
193
|
+
|
|
194
|
+
return <ul>{todos.map((todo) => <li key={todo.id}>{todo.title}</li>)}</ul>;
|
|
234
195
|
}
|
|
235
196
|
```
|
|
236
197
|
|
|
237
|
-
##
|
|
238
|
-
|
|
198
|
+
## Schema evolution without wiping user data
|
|
199
|
+
|
|
200
|
+
Offline-first apps get painful once your record shapes start changing. `dbsync` gives you two ways to handle that cleanly.
|
|
239
201
|
|
|
240
|
-
|
|
202
|
+
### `defaultSetter`: normalize data before it is written
|
|
203
|
+
|
|
204
|
+
Use `defaultSetter` to fill in missing values or add dynamic fields before `add()` and `put()` are persisted.
|
|
241
205
|
|
|
242
206
|
```typescript
|
|
243
|
-
|
|
244
|
-
|
|
207
|
+
const db = new DbSync({
|
|
208
|
+
adapter,
|
|
209
|
+
tables: {
|
|
210
|
+
posts: {
|
|
211
|
+
defaultSetter: (post) => ({
|
|
212
|
+
updatedAt: Date.now(),
|
|
213
|
+
...post,
|
|
214
|
+
}),
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
```
|
|
245
219
|
|
|
246
|
-
|
|
247
|
-
|
|
220
|
+
You can also call the same logic directly without writing anything:
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
const normalizedPost = db.applyDefaults('posts', { title: 'Draft' });
|
|
224
|
+
|
|
225
|
+
const postsRepo = new DbRepository<Post>(db, 'posts');
|
|
226
|
+
const normalizedViaRepo = postsRepo.applyDefaults({ title: 'Draft' });
|
|
248
227
|
```
|
|
249
228
|
|
|
250
|
-
|
|
229
|
+
### `migrations`: upgrade records already stored on device
|
|
230
|
+
|
|
231
|
+
Migrations run during initialization so long-lived offline data can move forward with your model instead of being discarded.
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
import { DbSync, type Migration } from '@slimr/dbsync';
|
|
251
235
|
|
|
236
|
+
const userMigrations: Migration[] = [
|
|
237
|
+
{
|
|
238
|
+
version: 2,
|
|
239
|
+
note: 'Merge firstName and lastName into fullName',
|
|
240
|
+
upgrade: async (record) => {
|
|
241
|
+
record.fullName = `${record.firstName} ${record.lastName}`.trim();
|
|
242
|
+
delete record.firstName;
|
|
243
|
+
delete record.lastName;
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
];
|
|
252
247
|
|
|
253
|
-
|
|
254
|
-
|
|
248
|
+
const db = new DbSync({
|
|
249
|
+
adapter,
|
|
250
|
+
tables: {
|
|
251
|
+
users: {
|
|
252
|
+
migrations: userMigrations,
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
});
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
If you need to upgrade imported JSON before storing it, `upgradeRecord()` applies the same migrations on demand without writing anything back to IndexedDB.
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
const upgradedUser = await db.upgradeRecord('users', importedUser);
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Automatic schema versioning
|
|
265
|
+
|
|
266
|
+
By default, `dbsync` computes a deterministic schema signature from your tables and indexes. When that signature changes, the local IndexedDB version bumps automatically and the new schema state is announced through sync so other devices can react safely.
|
|
267
|
+
|
|
268
|
+
If you prefer stricter control, provide `version: number` and `dbsync` will enforce that exact version instead.
|
|
269
|
+
|
|
270
|
+
## Sync lifecycle and session helpers
|
|
271
|
+
|
|
272
|
+
The consumer-facing API stays small even though the runtime work is not.
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
await db.start();
|
|
276
|
+
await db.waitForLive();
|
|
277
|
+
|
|
278
|
+
db.onSyncStateChange((state) => {
|
|
279
|
+
console.log('sync state:', state);
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
await db.triggerSync();
|
|
283
|
+
await db.stop();
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
`DbSync` also wraps the basic auth lifecycle so local data and remote sync stay aligned with the user session.
|
|
255
287
|
|
|
256
288
|
```typescript
|
|
257
|
-
// Authenticate and unlock syncing
|
|
258
289
|
await db.login('user@email.com', '123456');
|
|
290
|
+
await db.logout();
|
|
259
291
|
|
|
260
|
-
//
|
|
292
|
+
// Wipes local IndexedDB and logs out
|
|
261
293
|
await db.reset();
|
|
262
294
|
```
|
|
295
|
+
|
|
296
|
+
## Adapters
|
|
297
|
+
|
|
298
|
+
- [Adapters overview](./docs/Adapters.md)
|
|
299
|
+
- [RestAdapter](./docs/RestAdapter.md) for `swift-crud`
|
|
300
|
+
- [LocalAdapter](./docs/LocalAdapter.md) for local-only usage
|
|
301
|
+
|
|
302
|
+
If you already have a backend, you can implement the adapter contract yourself and keep the rest of the `dbsync` runtime exactly the same.
|
|
303
|
+
|
|
304
|
+
## When `dbsync` is a strong fit
|
|
305
|
+
|
|
306
|
+
- Your users expect the app to remain usable with poor or intermittent connectivity.
|
|
307
|
+
- You want local-first UX without writing your own queueing and replay system.
|
|
308
|
+
- You need browser tabs to stay consistent without inventing another cache invalidation layer.
|
|
309
|
+
- You want a small API that still supports schema evolution, typed repositories, and background synchronization.
|
|
310
|
+
|
|
311
|
+
## Context
|
|
312
|
+
|
|
313
|
+
`@slimr` is a set of slim React-oriented libraries. Explore the monorepo on [GitHub](https://github.com/bdombro/slimr).
|
package/cjs/DbRepository.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare class DbRepository<T> {
|
|
|
41
41
|
* @param value The partial object payload.
|
|
42
42
|
* @returns A promise resolving to the normalized record.
|
|
43
43
|
*/
|
|
44
|
-
applyDefaults(value: Partial<T>):
|
|
44
|
+
applyDefaults(value: Partial<T>): T;
|
|
45
45
|
/**
|
|
46
46
|
* Inserts or updates an existing record in the object store.
|
|
47
47
|
*
|
package/cjs/DbRepository.js
CHANGED
package/cjs/DbRepository.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DbRepository.js","sourceRoot":"","sources":["../src/DbRepository.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,MAAa,YAAY;IAQb;IACM;IARjB;;;;;OAKG;IACH,YACW,EAAU,EACJ,SAAiB;QADvB,OAAE,GAAF,EAAE,CAAQ;QACJ,cAAS,GAAT,SAAS,CAAQ;IAC/B,CAAC;IAEJ;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAmB;QACjC,OAAO,IAAI,CAAC,EAAE,CAAC,GAAG,CAAI,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO;QACZ,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CAAI,IAAI,CAAC,SAAS,CAAC,CAAA;IAC1C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,GAAG,CAAC,KAAiB,EAAE,GAAqB;QACjD,OAAO,IAAI,CAAC,EAAE,CAAC,GAAG,CAAI,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;IAClD,CAAC;IAED;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"DbRepository.js","sourceRoot":"","sources":["../src/DbRepository.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,MAAa,YAAY;IAQb;IACM;IARjB;;;;;OAKG;IACH,YACW,EAAU,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IACH,KAAK,CAAC,KAAK;QACV,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC;CACD;AA5FD,oCA4FC"}
|
package/cjs/DbSync.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare class DbSync {
|
|
|
51
51
|
/** Applies the configured migrations for a single store to the provided record. */
|
|
52
52
|
upgradeRecord<T extends Record<string, any>>(storeName: string, record: T): Promise<T>;
|
|
53
53
|
/** Applies the configured defaultSetter/defaulting logic for a single store without persisting. */
|
|
54
|
-
applyDefaults<T extends Record<string, any>>(storeName: string, record: T):
|
|
54
|
+
applyDefaults<T extends Record<string, any>>(storeName: string, record: T): T;
|
|
55
55
|
/** Returns a queued transaction object for batched writes. */
|
|
56
56
|
getTransaction(): import("./internal/DbTransaction.js").DbTransaction;
|
|
57
57
|
/** Reads a typed record by primary key. */
|
package/cjs/DbSync.js
CHANGED
|
@@ -74,7 +74,7 @@ class DbSync {
|
|
|
74
74
|
return upgradedRecord;
|
|
75
75
|
}
|
|
76
76
|
/** Applies the configured defaultSetter/defaulting logic for a single store without persisting. */
|
|
77
|
-
|
|
77
|
+
applyDefaults(storeName, record) {
|
|
78
78
|
return (0, StorageManager_js_1.applyDefaults)(this.config.tables[storeName], record);
|
|
79
79
|
}
|
|
80
80
|
/** Returns a queued transaction object for batched writes. */
|
package/cjs/DbSync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DbSync.js","sourceRoot":"","sources":["../src/DbSync.ts"],"names":[],"mappings":";;;AAAA,sCAAuC;AAEvC,8DAAuD;AACvD,wDAAiE;AACjE,wEAGuC;AACvC,oEAA4E;AAC5E,4DAAqD;AAyBrD;;GAEG;AACH,MAAa,MAAM;IAClB,oEAAoE;IAC7D,YAAY,GAAG,IAAI,CAAA;IAC1B,uDAAuD;IAChD,MAAM,CAAc;IAE3B,gEAAgE;IACxD,MAAM,CAAU;IACxB,qEAAqE;I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O;YAAE,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QAEpC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;IACxB,CAAC;IACD,iDAAiD;IAC1C,KAAK,CAAC,IAAI;QAChB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;IACvB,CAAC;IACD,6DAA6D;IACtD,KAAK,CAAC,WAAW;QACvB,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA;IACrC,CAAC;IACD,gDAAgD;IACzC,KAAK,CAAC,WAAW;QACvB,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA;IACrC,CAAC;IAED,mCAAmC;IAC5B,iBAAiB;QACvB,IAAI,CAAC,KAAK,EAAE,CAAA;IACb,CAAC;IACD,oCAAoC;IAC7B,gBAAgB;QACtB,IAAI,CAAC,IAAI,EAAE,CAAA;IACZ,CAAC;IAED,4EAA4E;IAClE,sBAAsB;QAC/B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;QACtB,IAAI,CAAC,IAAI,EAAE,CAAA;QACX,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YACnC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;QACzB,CAAC;IACF,CAAC;IAED,6DAA6D;IACtD,OAAO;QACb,IAAI,CAAC,IAAI,EAAE,CAAA;QACX,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAA;QACrB,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;IACvB,CAAC;CACD;AApND,wBAoNC"}
|
package/esm/DbRepository.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare class DbRepository<T> {
|
|
|
41
41
|
* @param value The partial object payload.
|
|
42
42
|
* @returns A promise resolving to the normalized record.
|
|
43
43
|
*/
|
|
44
|
-
applyDefaults(value: Partial<T>):
|
|
44
|
+
applyDefaults(value: Partial<T>): T;
|
|
45
45
|
/**
|
|
46
46
|
* Inserts or updates an existing record in the object store.
|
|
47
47
|
*
|
package/esm/DbRepository.js
CHANGED
|
@@ -49,7 +49,7 @@ export class DbRepository {
|
|
|
49
49
|
* @param value The partial object payload.
|
|
50
50
|
* @returns A promise resolving to the normalized record.
|
|
51
51
|
*/
|
|
52
|
-
|
|
52
|
+
applyDefaults(value) {
|
|
53
53
|
return this.db.applyDefaults(this.storeName, value);
|
|
54
54
|
}
|
|
55
55
|
/**
|
package/esm/DbRepository.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DbRepository.js","sourceRoot":"","sources":["../src/DbRepository.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAQb;IACM;IARjB;;;;;OAKG;IACH,YACW,EAAU,EACJ,SAAiB;QADvB,OAAE,GAAF,EAAE,CAAQ;QACJ,cAAS,GAAT,SAAS,CAAQ;IAC/B,CAAC;IAEJ;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAmB;QACjC,OAAO,IAAI,CAAC,EAAE,CAAC,GAAG,CAAI,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO;QACZ,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CAAI,IAAI,CAAC,SAAS,CAAC,CAAA;IAC1C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,GAAG,CAAC,KAAiB,EAAE,GAAqB;QACjD,OAAO,IAAI,CAAC,EAAE,CAAC,GAAG,CAAI,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;IAClD,CAAC;IAED;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"DbRepository.js","sourceRoot":"","sources":["../src/DbRepository.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAQb;IACM;IARjB;;;;;OAKG;IACH,YACW,EAAU,EACJ,SAAiB;QADv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KAAK;QACV,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC;CACD"}
|
package/esm/DbSync.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare class DbSync {
|
|
|
51
51
|
/** Applies the configured migrations for a single store to the provided record. */
|
|
52
52
|
upgradeRecord<T extends Record<string, any>>(storeName: string, record: T): Promise<T>;
|
|
53
53
|
/** Applies the configured defaultSetter/defaulting logic for a single store without persisting. */
|
|
54
|
-
applyDefaults<T extends Record<string, any>>(storeName: string, record: T):
|
|
54
|
+
applyDefaults<T extends Record<string, any>>(storeName: string, record: T): T;
|
|
55
55
|
/** Returns a queued transaction object for batched writes. */
|
|
56
56
|
getTransaction(): import("./internal/DbTransaction.js").DbTransaction;
|
|
57
57
|
/** Reads a typed record by primary key. */
|
package/esm/DbSync.js
CHANGED
|
@@ -71,7 +71,7 @@ export class DbSync {
|
|
|
71
71
|
return upgradedRecord;
|
|
72
72
|
}
|
|
73
73
|
/** Applies the configured defaultSetter/defaulting logic for a single store without persisting. */
|
|
74
|
-
|
|
74
|
+
applyDefaults(storeName, record) {
|
|
75
75
|
return applyDefaults(this.config.tables[storeName], record);
|
|
76
76
|
}
|
|
77
77
|
/** Returns a queued transaction object for batched writes. */
|
package/esm/DbSync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DbSync.js","sourceRoot":"","sources":["../src/DbSync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAkB,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAEN,gBAAgB,GAChB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM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