@tanstack/db-sqlite-persistence-core 0.4.8 → 0.4.9

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.
@@ -73,6 +73,7 @@ export type TransportedLoadSubsetOptions = {
73
73
  limit?: number
74
74
  cursor?: RemoteSubsetWireCursor
75
75
  offset?: number
76
+ refetch?: boolean
76
77
  }
77
78
 
78
79
  export class RemoteSubsetWireValueError extends TypeError {
@@ -157,6 +158,7 @@ function visitLoadSubsetOptions(
157
158
  `limit`,
158
159
  `cursor`,
159
160
  `offset`,
161
+ `refetch`,
160
162
  `signal`,
161
163
  `subscription`,
162
164
  ])
@@ -180,6 +182,7 @@ function visitLoadSubsetOptions(
180
182
  const limit = readDataProperty(options, `limit`, `options.limit`)
181
183
  const cursor = readDataProperty(options, `cursor`, `options.cursor`)
182
184
  const offset = readDataProperty(options, `offset`, `options.offset`)
185
+ const refetch = readDataProperty(options, `refetch`, `options.refetch`)
183
186
 
184
187
  if (where.present && where.value !== undefined) {
185
188
  const result = projectExpression(where.value, `options.where`, state)
@@ -201,6 +204,15 @@ function visitLoadSubsetOptions(
201
204
  const result = projectNumber(offset.value, `options.offset`)
202
205
  if (!state.validateOnly) projected.offset = result
203
206
  }
207
+ if (refetch.present && refetch.value !== undefined) {
208
+ if (typeof refetch.value !== `boolean`) {
209
+ throw new RemoteSubsetWireValueError(
210
+ `options.refetch`,
211
+ `expected boolean`,
212
+ )
213
+ }
214
+ if (!state.validateOnly) projected.refetch = refetch.value
215
+ }
204
216
 
205
217
  return projected
206
218
  }