@livestore/livestore 0.5.0-dev.0 → 0.5.0
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/dist/.tsbuildinfo +1 -1
- package/dist/QueryCache.d.ts.map +1 -1
- package/dist/SqliteDbWrapper.d.ts +1 -1
- package/dist/SqliteDbWrapper.d.ts.map +1 -1
- package/dist/SqliteDbWrapper.js +2 -2
- package/dist/SqliteDbWrapper.js.map +1 -1
- package/dist/SqliteDbWrapper.test.js +2 -2
- package/dist/effect/LiveStore.d.ts +54 -2
- package/dist/effect/LiveStore.d.ts.map +1 -1
- package/dist/effect/LiveStore.js +5 -3
- package/dist/effect/LiveStore.js.map +1 -1
- package/dist/effect/LiveStore.test.js +2 -2
- package/dist/effect/mod.js +2 -2
- package/dist/internal/mod.js +2 -2
- package/dist/live-queries/base-class.d.ts +1 -1
- package/dist/live-queries/base-class.d.ts.map +1 -1
- package/dist/live-queries/base-class.js +2 -2
- package/dist/live-queries/base-class.js.map +1 -1
- package/dist/live-queries/client-document-get-query.d.ts.map +1 -1
- package/dist/live-queries/client-document-get-query.js +1 -1
- package/dist/live-queries/computed.d.ts +1 -1
- package/dist/live-queries/computed.d.ts.map +1 -1
- package/dist/live-queries/computed.js +2 -2
- package/dist/live-queries/db-query.d.ts +1 -1
- package/dist/live-queries/db-query.d.ts.map +1 -1
- package/dist/live-queries/db-query.js +5 -5
- package/dist/live-queries/db-query.test.js +6 -6
- package/dist/live-queries/mod.js +4 -4
- package/dist/live-queries/signal.d.ts +1 -1
- package/dist/live-queries/signal.d.ts.map +1 -1
- package/dist/live-queries/signal.js +1 -1
- package/dist/live-queries/signal.test.js +3 -3
- package/dist/mod.js +8 -8
- package/dist/reactive.d.ts.map +1 -1
- package/dist/reactive.test.js +1 -1
- package/dist/store/StoreRegistry.d.ts.map +1 -1
- package/dist/store/StoreRegistry.js +1 -1
- package/dist/store/StoreRegistry.js.map +1 -1
- package/dist/store/StoreRegistry.test.js +3 -3
- package/dist/store/StoreRegistry.test.js.map +1 -1
- package/dist/store/create-store.d.ts +15 -1
- package/dist/store/create-store.d.ts.map +1 -1
- package/dist/store/create-store.js +14 -5
- package/dist/store/create-store.js.map +1 -1
- package/dist/store/create-store.test.d.ts +2 -0
- package/dist/store/create-store.test.d.ts.map +1 -0
- package/dist/store/create-store.test.js +28 -0
- package/dist/store/create-store.test.js.map +1 -0
- package/dist/store/devtools.js +3 -3
- package/dist/store/devtools.js.map +1 -1
- package/dist/store/store-commit.test.d.ts +2 -0
- package/dist/store/store-commit.test.d.ts.map +1 -0
- package/dist/store/store-commit.test.js +85 -0
- package/dist/store/store-commit.test.js.map +1 -0
- package/dist/store/store-eventstream.test.js +1 -1
- package/dist/store/store-types.d.ts.map +1 -1
- package/dist/store/store-types.js +1 -1
- package/dist/store/store-types.test.js +3 -3
- package/dist/store/store.d.ts +13 -14
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +35 -35
- package/dist/store/store.js.map +1 -1
- package/dist/utils/data-structures.d.ts.map +1 -1
- package/dist/utils/dev.d.ts.map +1 -1
- package/dist/utils/function-string.d.ts +3 -3
- package/dist/utils/function-string.d.ts.map +1 -1
- package/dist/utils/stack-info.d.ts.map +1 -1
- package/dist/utils/stack-info.test.js +1 -1
- package/dist/utils/tests/fixture.d.ts.map +1 -1
- package/dist/utils/tests/fixture.js.map +1 -1
- package/dist/utils/tests/mod.js +3 -3
- package/dist/utils/tests/otel.d.ts +6 -6
- package/dist/utils/tests/otel.d.ts.map +1 -1
- package/package.json +40 -40
- package/src/SqliteDbWrapper.ts +1 -1
- package/src/effect/LiveStore.ts +4 -1
- package/src/live-queries/__snapshots__/db-query.test.ts.snap +108 -126
- package/src/live-queries/base-class.ts +1 -1
- package/src/store/create-store.test.ts +35 -0
- package/src/store/create-store.ts +32 -11
- package/src/store/store-commit.test.ts +137 -0
- package/src/store/store.ts +37 -40
package/package.json
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$genie": {
|
|
3
|
+
"source": "package.json.genie.ts",
|
|
4
|
+
"warning": "DO NOT EDIT - changes will be overwritten",
|
|
5
|
+
"workspaceClosureDirs": [
|
|
6
|
+
"packages/@livestore/adapter-web",
|
|
7
|
+
"packages/@livestore/common",
|
|
8
|
+
"packages/@livestore/common-cf",
|
|
9
|
+
"packages/@livestore/livestore",
|
|
10
|
+
"packages/@livestore/sqlite-wasm",
|
|
11
|
+
"packages/@livestore/utils",
|
|
12
|
+
"packages/@livestore/utils-dev",
|
|
13
|
+
"packages/@livestore/wa-sqlite",
|
|
14
|
+
"packages/@livestore/webmesh"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
2
17
|
"name": "@livestore/livestore",
|
|
3
|
-
"version": "0.5.0
|
|
18
|
+
"version": "0.5.0",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"sideEffects": false,
|
|
4
21
|
"license": "Apache-2.0",
|
|
5
22
|
"repository": {
|
|
6
23
|
"type": "git",
|
|
7
24
|
"url": "git+https://github.com/livestorejs/livestore.git"
|
|
8
25
|
},
|
|
9
|
-
"files": [
|
|
10
|
-
"dist",
|
|
11
|
-
"package.json",
|
|
12
|
-
"src",
|
|
13
|
-
"docs"
|
|
14
|
-
],
|
|
15
|
-
"type": "module",
|
|
16
|
-
"sideEffects": false,
|
|
17
26
|
"exports": {
|
|
18
27
|
".": "./dist/mod.js",
|
|
19
28
|
"./internal": "./dist/internal/mod.js",
|
|
20
29
|
"./internal/testing-utils": "./dist/utils/tests/mod.js",
|
|
21
30
|
"./effect": "./dist/effect/mod.js"
|
|
22
31
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"package.json",
|
|
35
|
+
"src",
|
|
36
|
+
"docs"
|
|
37
|
+
],
|
|
26
38
|
"dependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"@livestore/
|
|
29
|
-
"@
|
|
39
|
+
"@livestore/common": "^0.5.0",
|
|
40
|
+
"@livestore/utils": "^0.5.0",
|
|
41
|
+
"@opentelemetry/api": "1.9.0"
|
|
30
42
|
},
|
|
31
43
|
"devDependencies": {
|
|
44
|
+
"@livestore/adapter-web": "^0.5.0",
|
|
45
|
+
"@livestore/utils-dev": "^0.5.0",
|
|
32
46
|
"@opentelemetry/sdk-trace-base": "2.2.0",
|
|
33
47
|
"jsdom": "26.1.0",
|
|
34
|
-
"typescript": "
|
|
48
|
+
"typescript": "7.0.2",
|
|
35
49
|
"vite": "7.3.1",
|
|
36
|
-
"vitest": "4.1.9"
|
|
37
|
-
"@livestore/adapter-web": "^0.5.0-dev.0",
|
|
38
|
-
"@livestore/utils-dev": "^0.5.0-dev.0"
|
|
50
|
+
"vitest": "4.1.9"
|
|
39
51
|
},
|
|
40
52
|
"peerDependencies": {
|
|
41
|
-
"@effect/opentelemetry": "^4.0.
|
|
42
|
-
"@effect/platform-browser": "^4.0.
|
|
43
|
-
"@effect/platform-bun": "^4.0.
|
|
44
|
-
"@effect/platform-node": "^4.0.
|
|
45
|
-
"@effect/platform-node-shared": "^4.0.
|
|
46
|
-
"@effect/vitest": "^4.0.
|
|
53
|
+
"@effect/opentelemetry": "^4.0.3",
|
|
54
|
+
"@effect/platform-browser": "^4.0.3",
|
|
55
|
+
"@effect/platform-bun": "^4.0.3",
|
|
56
|
+
"@effect/platform-node": "^4.0.3",
|
|
57
|
+
"@effect/platform-node-shared": "^4.0.3",
|
|
58
|
+
"@effect/vitest": "^4.0.3",
|
|
47
59
|
"@opentelemetry/api": "^1.9.0",
|
|
48
60
|
"@opentelemetry/resources": "^2.2.0",
|
|
49
61
|
"@standard-schema/spec": "^1.1.0",
|
|
50
|
-
"effect": "^4.0.
|
|
62
|
+
"effect": "^4.0.3"
|
|
51
63
|
},
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"warning": "DO NOT EDIT - changes will be overwritten",
|
|
55
|
-
"workspaceClosureDirs": [
|
|
56
|
-
"packages/@livestore/adapter-web",
|
|
57
|
-
"packages/@livestore/common",
|
|
58
|
-
"packages/@livestore/common-cf",
|
|
59
|
-
"packages/@livestore/livestore",
|
|
60
|
-
"packages/@livestore/sqlite-wasm",
|
|
61
|
-
"packages/@livestore/utils",
|
|
62
|
-
"packages/@livestore/utils-dev",
|
|
63
|
-
"packages/@livestore/wa-sqlite",
|
|
64
|
-
"packages/@livestore/webmesh"
|
|
65
|
-
]
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public"
|
|
66
66
|
},
|
|
67
67
|
"scripts": {
|
|
68
68
|
"build": "tsc",
|
package/src/SqliteDbWrapper.ts
CHANGED
|
@@ -217,7 +217,7 @@ export class SqliteDbWrapper implements SqliteDb {
|
|
|
217
217
|
span.recordException(cause)
|
|
218
218
|
span.end()
|
|
219
219
|
if (LS_DEV === true) {
|
|
220
|
-
// oxlint-disable-next-line
|
|
220
|
+
// oxlint-disable-next-line no-debugger -- intentional breakpoint for SQL errors during development
|
|
221
221
|
debugger
|
|
222
222
|
}
|
|
223
223
|
throw new SqliteError({ cause, query: { bindValues: bindValues ?? {}, sql: queryStr } })
|
package/src/effect/LiveStore.ts
CHANGED
|
@@ -34,6 +34,7 @@ export const makeLiveStoreContext = <
|
|
|
34
34
|
batchUpdates,
|
|
35
35
|
syncPayload,
|
|
36
36
|
syncPayloadSchema,
|
|
37
|
+
params,
|
|
37
38
|
}: LiveStoreContextProps<TSchema, TContext, TSyncPayloadSchema>): Effect.Effect<
|
|
38
39
|
LiveStoreContextRunning['Service'],
|
|
39
40
|
UnknownError | Cause.TimeoutError,
|
|
@@ -46,7 +47,7 @@ export const makeLiveStoreContext = <
|
|
|
46
47
|
storeId,
|
|
47
48
|
adapter,
|
|
48
49
|
batchUpdates,
|
|
49
|
-
...omitUndefineds({ context, boot, disableDevtools, onBootStatus, syncPayload, syncPayloadSchema }),
|
|
50
|
+
...omitUndefineds({ context, boot, disableDevtools, onBootStatus, syncPayload, syncPayloadSchema, params }),
|
|
50
51
|
})
|
|
51
52
|
|
|
52
53
|
return LiveStoreContextRunning.of({ stage: 'running', store } as any as LiveStoreContextRunning['Service'])
|
|
@@ -272,6 +273,7 @@ const makeStoreTag = <TSchema extends LiveStoreSchema, TStoreId extends string>(
|
|
|
272
273
|
onBootStatus: props.onBootStatus,
|
|
273
274
|
syncPayload: props.syncPayload,
|
|
274
275
|
syncPayloadSchema: props.syncPayloadSchema,
|
|
276
|
+
params: props.params,
|
|
275
277
|
}),
|
|
276
278
|
})
|
|
277
279
|
|
|
@@ -422,6 +424,7 @@ export const makeStoreContext =
|
|
|
422
424
|
onBootStatus: props.onBootStatus,
|
|
423
425
|
syncPayload: props.syncPayload,
|
|
424
426
|
syncPayloadSchema: props.syncPayloadSchema,
|
|
427
|
+
params: props.params,
|
|
425
428
|
}),
|
|
426
429
|
})
|
|
427
430
|
|
|
@@ -29,8 +29,7 @@ exports[`otel > QueryBuilder subscription - async iterator 1`] = `
|
|
|
29
29
|
{
|
|
30
30
|
"_name": "client-session-sync-processor:pull",
|
|
31
31
|
"attributes": {
|
|
32
|
-
"
|
|
33
|
-
"status.interrupted": true,
|
|
32
|
+
"effect.fiber.interrupted": true,
|
|
34
33
|
},
|
|
35
34
|
},
|
|
36
35
|
{
|
|
@@ -38,8 +37,7 @@ exports[`otel > QueryBuilder subscription - async iterator 1`] = `
|
|
|
38
37
|
"attributes": {
|
|
39
38
|
"batch": "undefined",
|
|
40
39
|
"batchSize": 1,
|
|
41
|
-
"
|
|
42
|
-
"status.interrupted": true,
|
|
40
|
+
"effect.fiber.interrupted": true,
|
|
43
41
|
},
|
|
44
42
|
},
|
|
45
43
|
],
|
|
@@ -105,9 +103,9 @@ exports[`otel > QueryBuilder subscription - async iterator 2`] = `
|
|
|
105
103
|
{
|
|
106
104
|
"_name": "LiveStore:commit",
|
|
107
105
|
"attributes": {
|
|
108
|
-
"livestore.eventTags":
|
|
109
|
-
|
|
110
|
-
]
|
|
106
|
+
"livestore.eventTags": [
|
|
107
|
+
"todo.created",
|
|
108
|
+
],
|
|
111
109
|
"livestore.eventsCount": 1,
|
|
112
110
|
},
|
|
113
111
|
"children": [
|
|
@@ -129,12 +127,12 @@ exports[`otel > QueryBuilder subscription - async iterator 2`] = `
|
|
|
129
127
|
{
|
|
130
128
|
"_name": "@livestore/common:execSql",
|
|
131
129
|
"attributes": {
|
|
132
|
-
"bindValueKeys":
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
]
|
|
130
|
+
"bindValueKeys": [
|
|
131
|
+
"$id",
|
|
132
|
+
"$seqNumGlobal",
|
|
133
|
+
"$seqNumClient",
|
|
134
|
+
"$seqNumRebaseGeneration",
|
|
135
|
+
],
|
|
138
136
|
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
139
137
|
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
140
138
|
},
|
|
@@ -187,8 +185,7 @@ exports[`otel > QueryBuilder subscription - async iterator with skipInitialRun 1
|
|
|
187
185
|
{
|
|
188
186
|
"_name": "client-session-sync-processor:pull",
|
|
189
187
|
"attributes": {
|
|
190
|
-
"
|
|
191
|
-
"status.interrupted": true,
|
|
188
|
+
"effect.fiber.interrupted": true,
|
|
192
189
|
},
|
|
193
190
|
},
|
|
194
191
|
{
|
|
@@ -196,8 +193,7 @@ exports[`otel > QueryBuilder subscription - async iterator with skipInitialRun 1
|
|
|
196
193
|
"attributes": {
|
|
197
194
|
"batch": "undefined",
|
|
198
195
|
"batchSize": 1,
|
|
199
|
-
"
|
|
200
|
-
"status.interrupted": true,
|
|
196
|
+
"effect.fiber.interrupted": true,
|
|
201
197
|
},
|
|
202
198
|
},
|
|
203
199
|
],
|
|
@@ -263,9 +259,9 @@ exports[`otel > QueryBuilder subscription - async iterator with skipInitialRun 2
|
|
|
263
259
|
{
|
|
264
260
|
"_name": "LiveStore:commit",
|
|
265
261
|
"attributes": {
|
|
266
|
-
"livestore.eventTags":
|
|
267
|
-
|
|
268
|
-
]
|
|
262
|
+
"livestore.eventTags": [
|
|
263
|
+
"todo.created",
|
|
264
|
+
],
|
|
269
265
|
"livestore.eventsCount": 1,
|
|
270
266
|
},
|
|
271
267
|
"children": [
|
|
@@ -287,12 +283,12 @@ exports[`otel > QueryBuilder subscription - async iterator with skipInitialRun 2
|
|
|
287
283
|
{
|
|
288
284
|
"_name": "@livestore/common:execSql",
|
|
289
285
|
"attributes": {
|
|
290
|
-
"bindValueKeys":
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
]
|
|
286
|
+
"bindValueKeys": [
|
|
287
|
+
"$id",
|
|
288
|
+
"$seqNumGlobal",
|
|
289
|
+
"$seqNumClient",
|
|
290
|
+
"$seqNumRebaseGeneration",
|
|
291
|
+
],
|
|
296
292
|
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
297
293
|
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
298
294
|
},
|
|
@@ -345,8 +341,7 @@ exports[`otel > QueryBuilder subscription - basic functionality 1`] = `
|
|
|
345
341
|
{
|
|
346
342
|
"_name": "client-session-sync-processor:pull",
|
|
347
343
|
"attributes": {
|
|
348
|
-
"
|
|
349
|
-
"status.interrupted": true,
|
|
344
|
+
"effect.fiber.interrupted": true,
|
|
350
345
|
},
|
|
351
346
|
},
|
|
352
347
|
{
|
|
@@ -354,8 +349,7 @@ exports[`otel > QueryBuilder subscription - basic functionality 1`] = `
|
|
|
354
349
|
"attributes": {
|
|
355
350
|
"batch": "undefined",
|
|
356
351
|
"batchSize": 1,
|
|
357
|
-
"
|
|
358
|
-
"status.interrupted": true,
|
|
352
|
+
"effect.fiber.interrupted": true,
|
|
359
353
|
},
|
|
360
354
|
},
|
|
361
355
|
],
|
|
@@ -421,9 +415,9 @@ exports[`otel > QueryBuilder subscription - basic functionality 2`] = `
|
|
|
421
415
|
{
|
|
422
416
|
"_name": "LiveStore:commit",
|
|
423
417
|
"attributes": {
|
|
424
|
-
"livestore.eventTags":
|
|
425
|
-
|
|
426
|
-
]
|
|
418
|
+
"livestore.eventTags": [
|
|
419
|
+
"todo.created",
|
|
420
|
+
],
|
|
427
421
|
"livestore.eventsCount": 1,
|
|
428
422
|
},
|
|
429
423
|
"children": [
|
|
@@ -445,12 +439,12 @@ exports[`otel > QueryBuilder subscription - basic functionality 2`] = `
|
|
|
445
439
|
{
|
|
446
440
|
"_name": "@livestore/common:execSql",
|
|
447
441
|
"attributes": {
|
|
448
|
-
"bindValueKeys":
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
]
|
|
442
|
+
"bindValueKeys": [
|
|
443
|
+
"$id",
|
|
444
|
+
"$seqNumGlobal",
|
|
445
|
+
"$seqNumClient",
|
|
446
|
+
"$seqNumRebaseGeneration",
|
|
447
|
+
],
|
|
454
448
|
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
455
449
|
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
456
450
|
},
|
|
@@ -503,8 +497,7 @@ exports[`otel > QueryBuilder subscription - direct table subscription 1`] = `
|
|
|
503
497
|
{
|
|
504
498
|
"_name": "client-session-sync-processor:pull",
|
|
505
499
|
"attributes": {
|
|
506
|
-
"
|
|
507
|
-
"status.interrupted": true,
|
|
500
|
+
"effect.fiber.interrupted": true,
|
|
508
501
|
},
|
|
509
502
|
},
|
|
510
503
|
{
|
|
@@ -512,8 +505,7 @@ exports[`otel > QueryBuilder subscription - direct table subscription 1`] = `
|
|
|
512
505
|
"attributes": {
|
|
513
506
|
"batch": "undefined",
|
|
514
507
|
"batchSize": 1,
|
|
515
|
-
"
|
|
516
|
-
"status.interrupted": true,
|
|
508
|
+
"effect.fiber.interrupted": true,
|
|
517
509
|
},
|
|
518
510
|
},
|
|
519
511
|
],
|
|
@@ -579,9 +571,9 @@ exports[`otel > QueryBuilder subscription - direct table subscription 2`] = `
|
|
|
579
571
|
{
|
|
580
572
|
"_name": "LiveStore:commit",
|
|
581
573
|
"attributes": {
|
|
582
|
-
"livestore.eventTags":
|
|
583
|
-
|
|
584
|
-
]
|
|
574
|
+
"livestore.eventTags": [
|
|
575
|
+
"todo.created",
|
|
576
|
+
],
|
|
585
577
|
"livestore.eventsCount": 1,
|
|
586
578
|
},
|
|
587
579
|
"children": [
|
|
@@ -603,12 +595,12 @@ exports[`otel > QueryBuilder subscription - direct table subscription 2`] = `
|
|
|
603
595
|
{
|
|
604
596
|
"_name": "@livestore/common:execSql",
|
|
605
597
|
"attributes": {
|
|
606
|
-
"bindValueKeys":
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
]
|
|
598
|
+
"bindValueKeys": [
|
|
599
|
+
"$id",
|
|
600
|
+
"$seqNumGlobal",
|
|
601
|
+
"$seqNumClient",
|
|
602
|
+
"$seqNumRebaseGeneration",
|
|
603
|
+
],
|
|
612
604
|
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
613
605
|
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
614
606
|
},
|
|
@@ -661,8 +653,7 @@ exports[`otel > QueryBuilder subscription - skipInitialRun 1`] = `
|
|
|
661
653
|
{
|
|
662
654
|
"_name": "client-session-sync-processor:pull",
|
|
663
655
|
"attributes": {
|
|
664
|
-
"
|
|
665
|
-
"status.interrupted": true,
|
|
656
|
+
"effect.fiber.interrupted": true,
|
|
666
657
|
},
|
|
667
658
|
},
|
|
668
659
|
{
|
|
@@ -670,8 +661,7 @@ exports[`otel > QueryBuilder subscription - skipInitialRun 1`] = `
|
|
|
670
661
|
"attributes": {
|
|
671
662
|
"batch": "undefined",
|
|
672
663
|
"batchSize": 1,
|
|
673
|
-
"
|
|
674
|
-
"status.interrupted": true,
|
|
664
|
+
"effect.fiber.interrupted": true,
|
|
675
665
|
},
|
|
676
666
|
},
|
|
677
667
|
],
|
|
@@ -737,9 +727,9 @@ exports[`otel > QueryBuilder subscription - skipInitialRun 2`] = `
|
|
|
737
727
|
{
|
|
738
728
|
"_name": "LiveStore:commit",
|
|
739
729
|
"attributes": {
|
|
740
|
-
"livestore.eventTags":
|
|
741
|
-
|
|
742
|
-
]
|
|
730
|
+
"livestore.eventTags": [
|
|
731
|
+
"todo.created",
|
|
732
|
+
],
|
|
743
733
|
"livestore.eventsCount": 1,
|
|
744
734
|
},
|
|
745
735
|
"children": [
|
|
@@ -761,12 +751,12 @@ exports[`otel > QueryBuilder subscription - skipInitialRun 2`] = `
|
|
|
761
751
|
{
|
|
762
752
|
"_name": "@livestore/common:execSql",
|
|
763
753
|
"attributes": {
|
|
764
|
-
"bindValueKeys":
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
]
|
|
754
|
+
"bindValueKeys": [
|
|
755
|
+
"$id",
|
|
756
|
+
"$seqNumGlobal",
|
|
757
|
+
"$seqNumClient",
|
|
758
|
+
"$seqNumRebaseGeneration",
|
|
759
|
+
],
|
|
770
760
|
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
771
761
|
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
772
762
|
},
|
|
@@ -819,8 +809,7 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 1`] = `
|
|
|
819
809
|
{
|
|
820
810
|
"_name": "client-session-sync-processor:pull",
|
|
821
811
|
"attributes": {
|
|
822
|
-
"
|
|
823
|
-
"status.interrupted": true,
|
|
812
|
+
"effect.fiber.interrupted": true,
|
|
824
813
|
},
|
|
825
814
|
},
|
|
826
815
|
{
|
|
@@ -828,8 +817,7 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 1`] = `
|
|
|
828
817
|
"attributes": {
|
|
829
818
|
"batch": "undefined",
|
|
830
819
|
"batchSize": 1,
|
|
831
|
-
"
|
|
832
|
-
"status.interrupted": true,
|
|
820
|
+
"effect.fiber.interrupted": true,
|
|
833
821
|
},
|
|
834
822
|
},
|
|
835
823
|
],
|
|
@@ -921,9 +909,9 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 2`] = `
|
|
|
921
909
|
{
|
|
922
910
|
"_name": "LiveStore:commit",
|
|
923
911
|
"attributes": {
|
|
924
|
-
"livestore.eventTags":
|
|
925
|
-
|
|
926
|
-
]
|
|
912
|
+
"livestore.eventTags": [
|
|
913
|
+
"todo.created",
|
|
914
|
+
],
|
|
927
915
|
"livestore.eventsCount": 1,
|
|
928
916
|
},
|
|
929
917
|
"children": [
|
|
@@ -945,12 +933,12 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 2`] = `
|
|
|
945
933
|
{
|
|
946
934
|
"_name": "@livestore/common:execSql",
|
|
947
935
|
"attributes": {
|
|
948
|
-
"bindValueKeys":
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
]
|
|
936
|
+
"bindValueKeys": [
|
|
937
|
+
"$id",
|
|
938
|
+
"$seqNumGlobal",
|
|
939
|
+
"$seqNumClient",
|
|
940
|
+
"$seqNumRebaseGeneration",
|
|
941
|
+
],
|
|
954
942
|
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
955
943
|
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
956
944
|
},
|
|
@@ -974,9 +962,9 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 2`] = `
|
|
|
974
962
|
{
|
|
975
963
|
"_name": "LiveStore:commit",
|
|
976
964
|
"attributes": {
|
|
977
|
-
"livestore.eventTags":
|
|
978
|
-
|
|
979
|
-
]
|
|
965
|
+
"livestore.eventTags": [
|
|
966
|
+
"todo.created",
|
|
967
|
+
],
|
|
980
968
|
"livestore.eventsCount": 1,
|
|
981
969
|
},
|
|
982
970
|
"children": [
|
|
@@ -998,12 +986,12 @@ exports[`otel > QueryBuilder subscription - unsubscribe functionality 2`] = `
|
|
|
998
986
|
{
|
|
999
987
|
"_name": "@livestore/common:execSql",
|
|
1000
988
|
"attributes": {
|
|
1001
|
-
"bindValueKeys":
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
]
|
|
989
|
+
"bindValueKeys": [
|
|
990
|
+
"$id",
|
|
991
|
+
"$seqNumGlobal",
|
|
992
|
+
"$seqNumClient",
|
|
993
|
+
"$seqNumRebaseGeneration",
|
|
994
|
+
],
|
|
1007
995
|
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
1008
996
|
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
1009
997
|
},
|
|
@@ -1056,8 +1044,7 @@ exports[`otel > otel 3`] = `
|
|
|
1056
1044
|
{
|
|
1057
1045
|
"_name": "client-session-sync-processor:pull",
|
|
1058
1046
|
"attributes": {
|
|
1059
|
-
"
|
|
1060
|
-
"status.interrupted": true,
|
|
1047
|
+
"effect.fiber.interrupted": true,
|
|
1061
1048
|
},
|
|
1062
1049
|
},
|
|
1063
1050
|
{
|
|
@@ -1065,8 +1052,7 @@ exports[`otel > otel 3`] = `
|
|
|
1065
1052
|
"attributes": {
|
|
1066
1053
|
"batch": "undefined",
|
|
1067
1054
|
"batchSize": 1,
|
|
1068
|
-
"
|
|
1069
|
-
"status.interrupted": true,
|
|
1055
|
+
"effect.fiber.interrupted": true,
|
|
1070
1056
|
},
|
|
1071
1057
|
},
|
|
1072
1058
|
],
|
|
@@ -1122,9 +1108,9 @@ exports[`otel > otel 4`] = `
|
|
|
1122
1108
|
{
|
|
1123
1109
|
"_name": "LiveStore:commit",
|
|
1124
1110
|
"attributes": {
|
|
1125
|
-
"livestore.eventTags":
|
|
1126
|
-
|
|
1127
|
-
]
|
|
1111
|
+
"livestore.eventTags": [
|
|
1112
|
+
"todo.created",
|
|
1113
|
+
],
|
|
1128
1114
|
"livestore.eventsCount": 1,
|
|
1129
1115
|
},
|
|
1130
1116
|
"children": [
|
|
@@ -1146,12 +1132,12 @@ exports[`otel > otel 4`] = `
|
|
|
1146
1132
|
{
|
|
1147
1133
|
"_name": "@livestore/common:execSql",
|
|
1148
1134
|
"attributes": {
|
|
1149
|
-
"bindValueKeys":
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
]
|
|
1135
|
+
"bindValueKeys": [
|
|
1136
|
+
"$id",
|
|
1137
|
+
"$seqNumGlobal",
|
|
1138
|
+
"$seqNumClient",
|
|
1139
|
+
"$seqNumRebaseGeneration",
|
|
1140
|
+
],
|
|
1155
1141
|
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
1156
1142
|
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
1157
1143
|
},
|
|
@@ -1376,8 +1362,7 @@ exports[`otel > with thunks 7`] = `
|
|
|
1376
1362
|
{
|
|
1377
1363
|
"_name": "client-session-sync-processor:pull",
|
|
1378
1364
|
"attributes": {
|
|
1379
|
-
"
|
|
1380
|
-
"status.interrupted": true,
|
|
1365
|
+
"effect.fiber.interrupted": true,
|
|
1381
1366
|
},
|
|
1382
1367
|
},
|
|
1383
1368
|
{
|
|
@@ -1385,8 +1370,7 @@ exports[`otel > with thunks 7`] = `
|
|
|
1385
1370
|
"attributes": {
|
|
1386
1371
|
"batch": "undefined",
|
|
1387
1372
|
"batchSize": 1,
|
|
1388
|
-
"
|
|
1389
|
-
"status.interrupted": true,
|
|
1373
|
+
"effect.fiber.interrupted": true,
|
|
1390
1374
|
},
|
|
1391
1375
|
},
|
|
1392
1376
|
],
|
|
@@ -1448,9 +1432,9 @@ exports[`otel > with thunks 8`] = `
|
|
|
1448
1432
|
{
|
|
1449
1433
|
"_name": "LiveStore:commit",
|
|
1450
1434
|
"attributes": {
|
|
1451
|
-
"livestore.eventTags":
|
|
1452
|
-
|
|
1453
|
-
]
|
|
1435
|
+
"livestore.eventTags": [
|
|
1436
|
+
"todo.created",
|
|
1437
|
+
],
|
|
1454
1438
|
"livestore.eventsCount": 1,
|
|
1455
1439
|
},
|
|
1456
1440
|
"children": [
|
|
@@ -1472,12 +1456,12 @@ exports[`otel > with thunks 8`] = `
|
|
|
1472
1456
|
{
|
|
1473
1457
|
"_name": "@livestore/common:execSql",
|
|
1474
1458
|
"attributes": {
|
|
1475
|
-
"bindValueKeys":
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
]
|
|
1459
|
+
"bindValueKeys": [
|
|
1460
|
+
"$id",
|
|
1461
|
+
"$seqNumGlobal",
|
|
1462
|
+
"$seqNumClient",
|
|
1463
|
+
"$seqNumRebaseGeneration",
|
|
1464
|
+
],
|
|
1481
1465
|
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
1482
1466
|
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
1483
1467
|
},
|
|
@@ -1530,8 +1514,7 @@ exports[`otel > with thunks with query builder and without labels 3`] = `
|
|
|
1530
1514
|
{
|
|
1531
1515
|
"_name": "client-session-sync-processor:pull",
|
|
1532
1516
|
"attributes": {
|
|
1533
|
-
"
|
|
1534
|
-
"status.interrupted": true,
|
|
1517
|
+
"effect.fiber.interrupted": true,
|
|
1535
1518
|
},
|
|
1536
1519
|
},
|
|
1537
1520
|
{
|
|
@@ -1539,8 +1522,7 @@ exports[`otel > with thunks with query builder and without labels 3`] = `
|
|
|
1539
1522
|
"attributes": {
|
|
1540
1523
|
"batch": "undefined",
|
|
1541
1524
|
"batchSize": 1,
|
|
1542
|
-
"
|
|
1543
|
-
"status.interrupted": true,
|
|
1525
|
+
"effect.fiber.interrupted": true,
|
|
1544
1526
|
},
|
|
1545
1527
|
},
|
|
1546
1528
|
],
|
|
@@ -1602,9 +1584,9 @@ exports[`otel > with thunks with query builder and without labels 4`] = `
|
|
|
1602
1584
|
{
|
|
1603
1585
|
"_name": "LiveStore:commit",
|
|
1604
1586
|
"attributes": {
|
|
1605
|
-
"livestore.eventTags":
|
|
1606
|
-
|
|
1607
|
-
]
|
|
1587
|
+
"livestore.eventTags": [
|
|
1588
|
+
"todo.created",
|
|
1589
|
+
],
|
|
1608
1590
|
"livestore.eventsCount": 1,
|
|
1609
1591
|
},
|
|
1610
1592
|
"children": [
|
|
@@ -1626,12 +1608,12 @@ exports[`otel > with thunks with query builder and without labels 4`] = `
|
|
|
1626
1608
|
{
|
|
1627
1609
|
"_name": "@livestore/common:execSql",
|
|
1628
1610
|
"attributes": {
|
|
1629
|
-
"bindValueKeys":
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
]
|
|
1611
|
+
"bindValueKeys": [
|
|
1612
|
+
"$id",
|
|
1613
|
+
"$seqNumGlobal",
|
|
1614
|
+
"$seqNumClient",
|
|
1615
|
+
"$seqNumRebaseGeneration",
|
|
1616
|
+
],
|
|
1635
1617
|
"span.label": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
1636
1618
|
"sql": "INSERT OR REPLACE INTO __livestore_state_head (id, seqNumGlobal, seqNumClient, seqNumRebaseGeneration) VALUES ($id, $seqNumGlobal, $seqNumClient, $seqNumRebaseGeneration)",
|
|
1637
1619
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as otel from '@opentelemetry/api'
|
|
2
2
|
|
|
3
|
-
import { Equal, Hash
|
|
3
|
+
import { Predicate, type Equal, type Hash } from '@livestore/utils/effect'
|
|
4
4
|
|
|
5
5
|
import * as RG from '../reactive.ts'
|
|
6
6
|
import type { QueryDebugInfo, RefreshReason } from '../store/store-types.ts'
|