@livestore/react 0.0.0-snapshot-23d1e79ec51925695af0547ffc9281927e2be153 → 0.0.0-snapshot-3eb4d291adbb7d8ba01e3c54701e78334273f27d
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/useRow.js +4 -4
- package/package.json +6 -6
- package/src/useRow.ts +4 -4
package/dist/useRow.js
CHANGED
|
@@ -35,14 +35,14 @@ export const useRow = (table, idOrOptions, options_) => {
|
|
|
35
35
|
shouldNeverHappen(`Table "${table.sqliteDef.name}" not found in schema`);
|
|
36
36
|
}
|
|
37
37
|
// console.debug('useRow', tableName, id)
|
|
38
|
-
const
|
|
38
|
+
const idVal = id === SessionIdSymbol ? 'session' : id;
|
|
39
39
|
const rowQuery = table.query.row;
|
|
40
40
|
const { query$, otelContext } = useMakeScopedQuery((otelContext) => DbSchema.tableIsSingleton(table)
|
|
41
41
|
? queryDb(rowQuery(), { reactivityGraph, otelContext })
|
|
42
|
-
: queryDb(rowQuery(id, { insertValues: insertValues }), { reactivityGraph, otelContext }), [
|
|
42
|
+
: queryDb(rowQuery(id, { insertValues: insertValues }), { reactivityGraph, otelContext }), [idVal, tableName], {
|
|
43
43
|
otel: {
|
|
44
|
-
spanName: `LiveStore:useRow:${tableName}${
|
|
45
|
-
attributes: { id:
|
|
44
|
+
spanName: `LiveStore:useRow:${tableName}${idVal === undefined ? '' : `:${idVal}`}`,
|
|
45
|
+
attributes: { id: idVal },
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
48
|
const query$Ref = useQueryRef(query$, otelContext);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/react",
|
|
3
|
-
"version": "0.0.0-snapshot-
|
|
3
|
+
"version": "0.0.0-snapshot-3eb4d291adbb7d8ba01e3c54701e78334273f27d",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@opentelemetry/api": "^1.9.0",
|
|
25
|
-
"@livestore/common": "0.0.0-snapshot-
|
|
26
|
-
"@livestore/db-schema": "0.0.0-snapshot-
|
|
27
|
-
"@livestore/livestore": "0.0.0-snapshot-
|
|
28
|
-
"@livestore/utils": "0.0.0-snapshot-
|
|
25
|
+
"@livestore/common": "0.0.0-snapshot-3eb4d291adbb7d8ba01e3c54701e78334273f27d",
|
|
26
|
+
"@livestore/db-schema": "0.0.0-snapshot-3eb4d291adbb7d8ba01e3c54701e78334273f27d",
|
|
27
|
+
"@livestore/livestore": "0.0.0-snapshot-3eb4d291adbb7d8ba01e3c54701e78334273f27d",
|
|
28
|
+
"@livestore/utils": "0.0.0-snapshot-3eb4d291adbb7d8ba01e3c54701e78334273f27d"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@opentelemetry/sdk-trace-base": "1.27.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"typescript": "5.5.4",
|
|
40
40
|
"vite": "5.4.10",
|
|
41
41
|
"vitest": "^2.1.4",
|
|
42
|
-
"@livestore/web": "0.0.0-snapshot-
|
|
42
|
+
"@livestore/web": "0.0.0-snapshot-3eb4d291adbb7d8ba01e3c54701e78334273f27d"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": "^18"
|
package/src/useRow.ts
CHANGED
|
@@ -107,7 +107,7 @@ export const useRow: {
|
|
|
107
107
|
|
|
108
108
|
// console.debug('useRow', tableName, id)
|
|
109
109
|
|
|
110
|
-
const
|
|
110
|
+
const idVal = id === SessionIdSymbol ? 'session' : id
|
|
111
111
|
const rowQuery = table.query.row as any
|
|
112
112
|
|
|
113
113
|
type Query$ = LiveQuery<RowQuery.Result<TTableDef>, QueryInfo.Row>
|
|
@@ -116,11 +116,11 @@ export const useRow: {
|
|
|
116
116
|
DbSchema.tableIsSingleton(table)
|
|
117
117
|
? (queryDb(rowQuery(), { reactivityGraph, otelContext }) as any as Query$)
|
|
118
118
|
: (queryDb(rowQuery(id!, { insertValues: insertValues! }), { reactivityGraph, otelContext }) as any as Query$),
|
|
119
|
-
[
|
|
119
|
+
[idVal!, tableName],
|
|
120
120
|
{
|
|
121
121
|
otel: {
|
|
122
|
-
spanName: `LiveStore:useRow:${tableName}${
|
|
123
|
-
attributes: { id:
|
|
122
|
+
spanName: `LiveStore:useRow:${tableName}${idVal === undefined ? '' : `:${idVal}`}`,
|
|
123
|
+
attributes: { id: idVal },
|
|
124
124
|
},
|
|
125
125
|
},
|
|
126
126
|
)
|