[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-tanstack-db-corecollection-setup":3,"mdc--x8wwjy-key":32,"related-org-tanstack-db-corecollection-setup":6533,"related-repo-tanstack-db-corecollection-setup":6677},{"slug":4,"name":5,"fn":6,"description":7,"org":8,"tags":12,"stars":21,"repoUrl":22,"updatedAt":23,"license":24,"forks":25,"topics":26,"repo":27,"sourceUrl":30,"mdContent":31},"db-corecollection-setup","db-core\u002Fcollection-setup","set up typed collections in TanStack DB","Creating typed collections with createCollection. Adapter selection: queryCollectionOptions (REST\u002FTanStack Query), electricCollectionOptions (ElectricSQL real-time sync), powerSyncCollectionOptions (PowerSync SQLite), rxdbCollectionOptions (RxDB), trailbaseCollectionOptions (TrailBase), localOnlyCollectionOptions, localStorageCollectionOptions. CollectionConfig options: getKey, schema, sync, gcTime, autoIndex (default off), defaultIndexType, syncMode (eager\u002Fon-demand, plus progressive for Electric). StandardSchema validation with Zod\u002FValibot\u002FArkType. Collection lifecycle (idle\u002Floading\u002Fready\u002Ferror). Adapter-specific sync patterns including Electric txid tracking, Query direct writes, and PowerSync query-driven sync with onLoad\u002FonLoadSubset hooks.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},"tanstack","TanStack","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftanstack.png",[13,17,20],{"name":14,"slug":15,"type":16},"Database","database","tag",{"name":18,"slug":19,"type":16},"Data Modeling","data-modeling",{"name":10,"slug":9,"type":16},3811,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Fdb","2026-07-26T05:48:58.321777",null,245,[],{"repoUrl":22,"stars":21,"forks":25,"topics":28,"description":29},[],"The reactive client store for your API.","https:\u002F\u002Fgithub.com\u002FTanStack\u002Fdb\u002Ftree\u002FHEAD\u002Fpackages\u002Fdb\u002Fskills\u002Fdb-core\u002Fcollection-setup","---\nname: db-core\u002Fcollection-setup\ndescription: >\n  Creating typed collections with createCollection. Adapter selection:\n  queryCollectionOptions (REST\u002FTanStack Query), electricCollectionOptions\n  (ElectricSQL real-time sync), powerSyncCollectionOptions (PowerSync SQLite),\n  rxdbCollectionOptions (RxDB), trailbaseCollectionOptions (TrailBase),\n  localOnlyCollectionOptions, localStorageCollectionOptions. CollectionConfig\n  options: getKey, schema, sync, gcTime, autoIndex (default off), defaultIndexType,\n  syncMode (eager\u002Fon-demand, plus progressive for Electric). StandardSchema validation\n  with Zod\u002FValibot\u002FArkType. Collection lifecycle (idle\u002Floading\u002Fready\u002Ferror).\n  Adapter-specific sync patterns including Electric txid tracking, Query direct\n  writes, and PowerSync query-driven sync with onLoad\u002FonLoadSubset hooks.\ntype: sub-skill\nlibrary: db\nlibrary_version: '0.6.0'\nsources:\n  - 'TanStack\u002Fdb:docs\u002Foverview.md'\n  - 'TanStack\u002Fdb:docs\u002Fguides\u002Fschemas.md'\n  - 'TanStack\u002Fdb:docs\u002Fcollections\u002Fquery-collection.md'\n  - 'TanStack\u002Fdb:docs\u002Fcollections\u002Felectric-collection.md'\n  - 'TanStack\u002Fdb:docs\u002Fcollections\u002Fpowersync-collection.md'\n  - 'TanStack\u002Fdb:docs\u002Fcollections\u002Frxdb-collection.md'\n  - 'TanStack\u002Fdb:docs\u002Fcollections\u002Ftrailbase-collection.md'\n  - 'TanStack\u002Fdb:packages\u002Fdb\u002Fsrc\u002Fcollection\u002Findex.ts'\n---\n\nThis skill builds on db-core. Read it first for the overall mental model.\n\n# Collection Setup & Schema\n\n## Setup\n\n```ts\nimport { createCollection } from '@tanstack\u002Freact-db'\nimport { queryCollectionOptions } from '@tanstack\u002Fquery-db-collection'\nimport { QueryClient } from '@tanstack\u002Fquery-core'\nimport { z } from 'zod'\n\nconst queryClient = new QueryClient()\n\nconst todoSchema = z.object({\n  id: z.number(),\n  text: z.string(),\n  completed: z.boolean().default(false),\n  created_at: z\n    .union([z.string(), z.date()])\n    .transform((val) => (typeof val === 'string' ? new Date(val) : val)),\n})\n\nconst todoCollection = createCollection(\n  queryCollectionOptions({\n    queryKey: ['todos'],\n    queryFn: async (ctx) => {\n      const res = await fetch('\u002Fapi\u002Ftodos', { signal: ctx.signal })\n      return res.json()\n    },\n    queryClient,\n    getKey: (item) => item.id,\n    schema: todoSchema,\n    onInsert: async ({ transaction }) => {\n      await api.todos.create(transaction.mutations[0].modified)\n    },\n    onUpdate: async ({ transaction }) => {\n      const mut = transaction.mutations[0]\n      await api.todos.update(mut.key, mut.changes)\n    },\n    onDelete: async ({ transaction }) => {\n      await api.todos.delete(transaction.mutations[0].key)\n    },\n  }),\n)\n```\n\n## Choosing an Adapter\n\n| Backend                          | Adapter                         | Package                             |\n| -------------------------------- | ------------------------------- | ----------------------------------- |\n| REST API \u002F TanStack Query        | `queryCollectionOptions`        | `@tanstack\u002Fquery-db-collection`     |\n| ElectricSQL (real-time Postgres) | `electricCollectionOptions`     | `@tanstack\u002Felectric-db-collection`  |\n| PowerSync (SQLite offline)       | `powerSyncCollectionOptions`    | `@tanstack\u002Fpowersync-db-collection` |\n| RxDB (reactive database)         | `rxdbCollectionOptions`         | `@tanstack\u002Frxdb-db-collection`      |\n| TrailBase (event streaming)      | `trailbaseCollectionOptions`    | `@tanstack\u002Ftrailbase-db-collection` |\n| No backend (UI state)            | `localOnlyCollectionOptions`    | `@tanstack\u002Fdb`                      |\n| Browser localStorage             | `localStorageCollectionOptions` | `@tanstack\u002Fdb`                      |\n\nIf the user specifies a backend (e.g. Electric, PowerSync), use that adapter directly. Only use `localOnlyCollectionOptions` when there is no backend yet — the collection API is uniform, so swapping to a real adapter later only changes the options creator.\n\n## Sync Modes\n\n```ts\nqueryCollectionOptions({\n  syncMode: 'eager', \u002F\u002F default — loads all data upfront\n  \u002F\u002F syncMode: \"on-demand\", \u002F\u002F loads only what live queries request\n  \u002F\u002F syncMode: \"progressive\", \u002F\u002F (Electric only) query subset first, full sync in background\n})\n```\n\n| Mode          | Best for                                                       | Data size |\n| ------------- | -------------------------------------------------------------- | --------- |\n| `eager`       | Mostly-static datasets                                         | \u003C10k rows |\n| `on-demand`   | Search, catalogs, large tables                                 | >50k rows |\n| `progressive` | Collaborative apps needing instant first paint (Electric only) | Any       |\n\nCalling `collection.preload()` on an on-demand collection is a no-op. Create\nthe live query for the required subset and call `liveQuery.preload()` instead.\n\nFor Query Collection request cancellation, cleanup boundaries, and shared\n`QueryClient` behavior, read\n[the Query adapter reference](references\u002Fquery-adapter.md#request-cancellation-and-cleanup).\n\n## Indexing\n\nIndexing is opt-in. The `autoIndex` option defaults to `\"off\"`. To enable automatic indexing, set `autoIndex: \"eager\"` and provide a `defaultIndexType`:\n\n```ts\nimport { BasicIndex } from '@tanstack\u002Fdb'\n\ncreateCollection(\n  queryCollectionOptions({\n    autoIndex: 'eager',\n    defaultIndexType: BasicIndex,\n    \u002F\u002F ...\n  }),\n)\n```\n\nWithout `defaultIndexType`, setting `autoIndex: \"eager\"` throws a `CollectionConfigurationError`. You can also create indexes manually with `collection.createIndex()` and remove them with `collection.removeIndex()`.\n\n## Core Patterns\n\n### Local-only collection for prototyping\n\n```ts\nimport {\n  createCollection,\n  localOnlyCollectionOptions,\n} from '@tanstack\u002Freact-db'\n\nconst todoCollection = createCollection(\n  localOnlyCollectionOptions({\n    getKey: (item) => item.id,\n    initialData: [{ id: 1, text: 'Learn TanStack DB', completed: false }],\n  }),\n)\n```\n\n### Schema with type transformations\n\n```ts\nconst schema = z.object({\n  id: z.number(),\n  title: z.string(),\n  due_date: z\n    .union([z.string(), z.date()])\n    .transform((val) => (typeof val === 'string' ? new Date(val) : val)),\n  priority: z.number().default(0),\n})\n```\n\nUse `z.union([z.string(), z.date()])` for transformed fields — this ensures `TInput` is a superset of `TOutput` so that `update()` works correctly with the draft proxy.\n\n### ElectricSQL with txid tracking\n\nAlways use a schema with Electric — without one, the collection types as `Record\u003Cstring, unknown>`.\n\n```ts\nimport { electricCollectionOptions } from '@tanstack\u002Felectric-db-collection'\nimport { z } from 'zod'\n\nconst todoSchema = z.object({\n  id: z.string(),\n  text: z.string(),\n  completed: z.boolean(),\n  created_at: z.coerce.date(),\n})\n\nconst todoCollection = createCollection(\n  electricCollectionOptions({\n    schema: todoSchema,\n    shapeOptions: { url: '\u002Fapi\u002Felectric\u002Ftodos' },\n    getKey: (item) => item.id,\n    onInsert: async ({ transaction }) => {\n      const res = await api.todos.create(transaction.mutations[0].modified)\n      return { txid: res.txid }\n    },\n  }),\n)\n```\n\nThe returned `txid` tells the collection to hold optimistic state until Electric streams back that transaction. See the [Electric adapter reference](references\u002Felectric-adapter.md) for the full dual-path pattern (schema + parser).\n\n## Common Mistakes\n\n### CRITICAL queryFn returning empty array deletes all data\n\nWrong:\n\n```ts\nqueryCollectionOptions({\n  queryFn: async () => {\n    const res = await fetch('\u002Fapi\u002Ftodos?status=active')\n    return res.json() \u002F\u002F returns [] when no active todos — deletes everything\n  },\n})\n```\n\nCorrect:\n\n```ts\nqueryCollectionOptions({\n  queryFn: async () => {\n    const res = await fetch('\u002Fapi\u002Ftodos') \u002F\u002F fetch complete state\n    return res.json()\n  },\n  \u002F\u002F Use on-demand mode + live query where() for filtering\n  syncMode: 'on-demand',\n})\n```\n\n`queryFn` result is treated as complete server state. Returning `[]` means \"server has no items\", deleting all existing collection data.\n\nSource: docs\u002Fcollections\u002Fquery-collection.md\n\n### CRITICAL Not using the correct adapter for your backend\n\nWrong:\n\n```ts\nconst todoCollection = createCollection(\n  localOnlyCollectionOptions({\n    getKey: (item) => item.id,\n  }),\n)\n\u002F\u002F Manually fetching and inserting...\n```\n\nCorrect:\n\n```ts\nconst todoCollection = createCollection(\n  queryCollectionOptions({\n    queryKey: ['todos'],\n    queryFn: async () => fetch('\u002Fapi\u002Ftodos').then((r) => r.json()),\n    queryClient,\n    getKey: (item) => item.id,\n  }),\n)\n```\n\nEach backend has a dedicated adapter that handles sync, mutation handlers, and utilities. Using `localOnlyCollectionOptions` or bare `createCollection` for a real backend bypasses all of this.\n\nSource: docs\u002Foverview.md\n\n### CRITICAL Electric txid queried outside mutation transaction\n\nWrong:\n\n```ts\n\u002F\u002F Backend handler\napp.post('\u002Fapi\u002Ftodos', async (req, res) => {\n  const txid = await generateTxId(sql) \u002F\u002F WRONG: separate transaction\n  await sql`INSERT INTO todos ${sql(req.body)}`\n  res.json({ txid })\n})\n```\n\nCorrect:\n\n```ts\napp.post('\u002Fapi\u002Ftodos', async (req, res) => {\n  let txid\n  await sql.begin(async (tx) => {\n    txid = await generateTxId(tx) \u002F\u002F CORRECT: same transaction\n    await tx`INSERT INTO todos ${tx(req.body)}`\n  })\n  res.json({ txid })\n})\n```\n\n`pg_current_xact_id()` must be queried inside the same SQL transaction as the mutation. Otherwise the txid doesn't match and `awaitTxId` times out (default 5 seconds).\n\nSource: docs\u002Fcollections\u002Felectric-collection.md\n\n### CRITICAL queryFn returning partial data without merging\n\nWrong:\n\n```ts\nqueryCollectionOptions({\n  queryFn: async () => {\n    const newItems = await fetch('\u002Fapi\u002Ftodos?since=' + lastSync)\n    return newItems.json() \u002F\u002F only new items — everything else deleted\n  },\n})\n```\n\nCorrect:\n\n```ts\nqueryCollectionOptions({\n  queryFn: async (ctx) => {\n    const existing = ctx.queryClient.getQueryData(['todos']) || []\n    const newItems = await fetch('\u002Fapi\u002Ftodos?since=' + lastSync).then((r) =>\n      r.json(),\n    )\n    return [...existing, ...newItems]\n  },\n})\n```\n\n`queryFn` result replaces all collection data. For incremental fetches, merge with existing data.\n\nSource: docs\u002Fcollections\u002Fquery-collection.md\n\n### HIGH Using async schema validation\n\nWrong:\n\n```ts\nconst schema = z.object({\n  email: z.string().refine(async (val) => {\n    const exists = await checkEmail(val)\n    return !exists\n  }),\n})\n```\n\nCorrect:\n\n```ts\nconst schema = z.object({\n  email: z.string().email(),\n})\n\u002F\u002F Do async validation in the mutation handler instead\n```\n\nSchema validation must be synchronous. Async validation throws `SchemaMustBeSynchronousError` at mutation time.\n\nSource: packages\u002Fdb\u002Fsrc\u002Fcollection\u002Fmutations.ts:101\n\n### HIGH getKey returning undefined for some items\n\nWrong:\n\n```ts\ncreateCollection(\n  queryCollectionOptions({\n    getKey: (item) => item.metadata.id, \u002F\u002F undefined if metadata missing\n  }),\n)\n```\n\nCorrect:\n\n```ts\ncreateCollection(\n  queryCollectionOptions({\n    getKey: (item) => item.id, \u002F\u002F always present\n  }),\n)\n```\n\n`getKey` must return a defined value for every item. Throws `UndefinedKeyError` otherwise.\n\nSource: packages\u002Fdb\u002Fsrc\u002Fcollection\u002Fmutations.ts:148\n\n### HIGH TInput not a superset of TOutput with schema transforms\n\nWrong:\n\n```ts\nconst schema = z.object({\n  created_at: z.string().transform((val) => new Date(val)),\n})\n\u002F\u002F update() fails — draft.created_at is Date but schema only accepts string\n```\n\nCorrect:\n\n```ts\nconst schema = z.object({\n  created_at: z\n    .union([z.string(), z.date()])\n    .transform((val) => (typeof val === 'string' ? new Date(val) : val)),\n})\n```\n\nWhen a schema transforms types, `TInput` must accept both the pre-transform and post-transform types for `update()` to work with the draft proxy.\n\nSource: docs\u002Fguides\u002Fschemas.md\n\n### HIGH React Native missing crypto.randomUUID polyfill\n\nTanStack DB uses `crypto.randomUUID()` internally. React Native doesn't provide this. Install `react-native-random-uuid` and import it at your app entry point.\n\nSource: docs\u002Foverview.md\n\n### MEDIUM Providing both explicit type parameter and schema\n\nWrong:\n\n```ts\ncreateCollection\u003CTodo>(queryCollectionOptions({ schema: todoSchema, ... }))\n```\n\nCorrect:\n\n```ts\ncreateCollection(queryCollectionOptions({ schema: todoSchema, ... }))\n```\n\nWhen a schema is provided, the collection infers types from it. An explicit generic creates conflicting type constraints.\n\nSource: docs\u002Foverview.md\n\n### MEDIUM Direct writes overridden by next query sync\n\nWrong:\n\n```ts\ntodoCollection.utils.writeInsert(newItem)\n\u002F\u002F Next queryFn execution replaces all data, losing the direct write\n```\n\nCorrect:\n\n```ts\ntodoCollection.utils.writeInsert(newItem)\n\u002F\u002F Use staleTime to prevent immediate refetch\n\u002F\u002F Or return { refetch: false } from mutation handlers\n```\n\nDirect writes update the collection immediately, but the next `queryFn` returns complete server state which overwrites them.\n\nSource: docs\u002Fcollections\u002Fquery-collection.md\n\n## References\n\n- [TanStack Query adapter](references\u002Fquery-adapter.md)\n- [ElectricSQL adapter](references\u002Felectric-adapter.md)\n- [PowerSync adapter](references\u002Fpowersync-adapter.md)\n- [RxDB adapter](references\u002Frxdb-adapter.md)\n- [TrailBase adapter](references\u002Ftrailbase-adapter.md)\n- [Local adapters (local-only, localStorage)](references\u002Flocal-adapters.md)\n- [Schema validation patterns](references\u002Fschema-patterns.md)\n\nSee also: db-core\u002Fmutations-optimistic\u002FSKILL.md — mutation handlers configured here execute during mutations.\n\nSee also: db-core\u002Fcustom-adapter\u002FSKILL.md — for building your own adapter.\n",{"data":33,"body":46},{"name":5,"description":7,"type":34,"library":35,"library_version":36,"sources":37},"sub-skill","db","0.6.0",[38,39,40,41,42,43,44,45],"TanStack\u002Fdb:docs\u002Foverview.md","TanStack\u002Fdb:docs\u002Fguides\u002Fschemas.md","TanStack\u002Fdb:docs\u002Fcollections\u002Fquery-collection.md","TanStack\u002Fdb:docs\u002Fcollections\u002Felectric-collection.md","TanStack\u002Fdb:docs\u002Fcollections\u002Fpowersync-collection.md","TanStack\u002Fdb:docs\u002Fcollections\u002Frxdb-collection.md","TanStack\u002Fdb:docs\u002Fcollections\u002Ftrailbase-collection.md","TanStack\u002Fdb:packages\u002Fdb\u002Fsrc\u002Fcollection\u002Findex.ts",{"type":47,"children":48},"root",[49,57,64,71,1411,1417,1630,1642,1648,1742,1834,1855,1876,1882,1918,2073,2115,2121,2128,2394,2400,2719,2756,2762,2774,3370,3390,3396,3402,3407,3552,3557,3731,3750,3755,3761,3765,3883,3887,4142,4161,4166,4172,4176,4402,4406,4682,4701,4706,4712,4716,4866,4870,5166,5176,5180,5186,5190,5377,5381,5486,5499,5504,5510,5514,5626,5630,5733,5752,5757,5763,5767,5900,5904,6106,6125,6130,6136,6157,6161,6167,6171,6247,6251,6309,6314,6318,6324,6328,6374,6378,6428,6440,6444,6450,6517,6522,6527],{"type":50,"tag":51,"props":52,"children":53},"element","p",{},[54],{"type":55,"value":56},"text","This skill builds on db-core. Read it first for the overall mental model.",{"type":50,"tag":58,"props":59,"children":61},"h1",{"id":60},"collection-setup-schema",[62],{"type":55,"value":63},"Collection Setup & Schema",{"type":50,"tag":65,"props":66,"children":68},"h2",{"id":67},"setup",[69],{"type":55,"value":70},"Setup",{"type":50,"tag":72,"props":73,"children":78},"pre",{"className":74,"code":75,"language":76,"meta":77,"style":77},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createCollection } from '@tanstack\u002Freact-db'\nimport { queryCollectionOptions } from '@tanstack\u002Fquery-db-collection'\nimport { QueryClient } from '@tanstack\u002Fquery-core'\nimport { z } from 'zod'\n\nconst queryClient = new QueryClient()\n\nconst todoSchema = z.object({\n  id: z.number(),\n  text: z.string(),\n  completed: z.boolean().default(false),\n  created_at: z\n    .union([z.string(), z.date()])\n    .transform((val) => (typeof val === 'string' ? new Date(val) : val)),\n})\n\nconst todoCollection = createCollection(\n  queryCollectionOptions({\n    queryKey: ['todos'],\n    queryFn: async (ctx) => {\n      const res = await fetch('\u002Fapi\u002Ftodos', { signal: ctx.signal })\n      return res.json()\n    },\n    queryClient,\n    getKey: (item) => item.id,\n    schema: todoSchema,\n    onInsert: async ({ transaction }) => {\n      await api.todos.create(transaction.mutations[0].modified)\n    },\n    onUpdate: async ({ transaction }) => {\n      const mut = transaction.mutations[0]\n      await api.todos.update(mut.key, mut.changes)\n    },\n    onDelete: async ({ transaction }) => {\n      await api.todos.delete(transaction.mutations[0].key)\n    },\n  }),\n)\n","ts","",[79],{"type":50,"tag":80,"props":81,"children":82},"code",{"__ignoreMap":77},[83,133,171,209,247,257,292,300,341,379,413,471,489,543,644,658,666,692,709,749,789,874,900,909,922,970,992,1032,1109,1117,1154,1196,1264,1272,1309,1378,1386,1403],{"type":50,"tag":84,"props":85,"children":88},"span",{"class":86,"line":87},"line",1,[89,95,101,107,112,117,122,128],{"type":50,"tag":84,"props":90,"children":92},{"style":91},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[93],{"type":55,"value":94},"import",{"type":50,"tag":84,"props":96,"children":98},{"style":97},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[99],{"type":55,"value":100}," {",{"type":50,"tag":84,"props":102,"children":104},{"style":103},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[105],{"type":55,"value":106}," createCollection",{"type":50,"tag":84,"props":108,"children":109},{"style":97},[110],{"type":55,"value":111}," }",{"type":50,"tag":84,"props":113,"children":114},{"style":91},[115],{"type":55,"value":116}," from",{"type":50,"tag":84,"props":118,"children":119},{"style":97},[120],{"type":55,"value":121}," '",{"type":50,"tag":84,"props":123,"children":125},{"style":124},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[126],{"type":55,"value":127},"@tanstack\u002Freact-db",{"type":50,"tag":84,"props":129,"children":130},{"style":97},[131],{"type":55,"value":132},"'\n",{"type":50,"tag":84,"props":134,"children":136},{"class":86,"line":135},2,[137,141,145,150,154,158,162,167],{"type":50,"tag":84,"props":138,"children":139},{"style":91},[140],{"type":55,"value":94},{"type":50,"tag":84,"props":142,"children":143},{"style":97},[144],{"type":55,"value":100},{"type":50,"tag":84,"props":146,"children":147},{"style":103},[148],{"type":55,"value":149}," queryCollectionOptions",{"type":50,"tag":84,"props":151,"children":152},{"style":97},[153],{"type":55,"value":111},{"type":50,"tag":84,"props":155,"children":156},{"style":91},[157],{"type":55,"value":116},{"type":50,"tag":84,"props":159,"children":160},{"style":97},[161],{"type":55,"value":121},{"type":50,"tag":84,"props":163,"children":164},{"style":124},[165],{"type":55,"value":166},"@tanstack\u002Fquery-db-collection",{"type":50,"tag":84,"props":168,"children":169},{"style":97},[170],{"type":55,"value":132},{"type":50,"tag":84,"props":172,"children":174},{"class":86,"line":173},3,[175,179,183,188,192,196,200,205],{"type":50,"tag":84,"props":176,"children":177},{"style":91},[178],{"type":55,"value":94},{"type":50,"tag":84,"props":180,"children":181},{"style":97},[182],{"type":55,"value":100},{"type":50,"tag":84,"props":184,"children":185},{"style":103},[186],{"type":55,"value":187}," QueryClient",{"type":50,"tag":84,"props":189,"children":190},{"style":97},[191],{"type":55,"value":111},{"type":50,"tag":84,"props":193,"children":194},{"style":91},[195],{"type":55,"value":116},{"type":50,"tag":84,"props":197,"children":198},{"style":97},[199],{"type":55,"value":121},{"type":50,"tag":84,"props":201,"children":202},{"style":124},[203],{"type":55,"value":204},"@tanstack\u002Fquery-core",{"type":50,"tag":84,"props":206,"children":207},{"style":97},[208],{"type":55,"value":132},{"type":50,"tag":84,"props":210,"children":212},{"class":86,"line":211},4,[213,217,221,226,230,234,238,243],{"type":50,"tag":84,"props":214,"children":215},{"style":91},[216],{"type":55,"value":94},{"type":50,"tag":84,"props":218,"children":219},{"style":97},[220],{"type":55,"value":100},{"type":50,"tag":84,"props":222,"children":223},{"style":103},[224],{"type":55,"value":225}," z",{"type":50,"tag":84,"props":227,"children":228},{"style":97},[229],{"type":55,"value":111},{"type":50,"tag":84,"props":231,"children":232},{"style":91},[233],{"type":55,"value":116},{"type":50,"tag":84,"props":235,"children":236},{"style":97},[237],{"type":55,"value":121},{"type":50,"tag":84,"props":239,"children":240},{"style":124},[241],{"type":55,"value":242},"zod",{"type":50,"tag":84,"props":244,"children":245},{"style":97},[246],{"type":55,"value":132},{"type":50,"tag":84,"props":248,"children":250},{"class":86,"line":249},5,[251],{"type":50,"tag":84,"props":252,"children":254},{"emptyLinePlaceholder":253},true,[255],{"type":55,"value":256},"\n",{"type":50,"tag":84,"props":258,"children":260},{"class":86,"line":259},6,[261,267,272,277,282,287],{"type":50,"tag":84,"props":262,"children":264},{"style":263},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[265],{"type":55,"value":266},"const",{"type":50,"tag":84,"props":268,"children":269},{"style":103},[270],{"type":55,"value":271}," queryClient ",{"type":50,"tag":84,"props":273,"children":274},{"style":97},[275],{"type":55,"value":276},"=",{"type":50,"tag":84,"props":278,"children":279},{"style":97},[280],{"type":55,"value":281}," new",{"type":50,"tag":84,"props":283,"children":285},{"style":284},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[286],{"type":55,"value":187},{"type":50,"tag":84,"props":288,"children":289},{"style":103},[290],{"type":55,"value":291},"()\n",{"type":50,"tag":84,"props":293,"children":295},{"class":86,"line":294},7,[296],{"type":50,"tag":84,"props":297,"children":298},{"emptyLinePlaceholder":253},[299],{"type":55,"value":256},{"type":50,"tag":84,"props":301,"children":303},{"class":86,"line":302},8,[304,308,313,317,321,326,331,336],{"type":50,"tag":84,"props":305,"children":306},{"style":263},[307],{"type":55,"value":266},{"type":50,"tag":84,"props":309,"children":310},{"style":103},[311],{"type":55,"value":312}," todoSchema ",{"type":50,"tag":84,"props":314,"children":315},{"style":97},[316],{"type":55,"value":276},{"type":50,"tag":84,"props":318,"children":319},{"style":103},[320],{"type":55,"value":225},{"type":50,"tag":84,"props":322,"children":323},{"style":97},[324],{"type":55,"value":325},".",{"type":50,"tag":84,"props":327,"children":328},{"style":284},[329],{"type":55,"value":330},"object",{"type":50,"tag":84,"props":332,"children":333},{"style":103},[334],{"type":55,"value":335},"(",{"type":50,"tag":84,"props":337,"children":338},{"style":97},[339],{"type":55,"value":340},"{\n",{"type":50,"tag":84,"props":342,"children":344},{"class":86,"line":343},9,[345,351,356,360,364,369,374],{"type":50,"tag":84,"props":346,"children":348},{"style":347},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[349],{"type":55,"value":350},"  id",{"type":50,"tag":84,"props":352,"children":353},{"style":97},[354],{"type":55,"value":355},":",{"type":50,"tag":84,"props":357,"children":358},{"style":103},[359],{"type":55,"value":225},{"type":50,"tag":84,"props":361,"children":362},{"style":97},[363],{"type":55,"value":325},{"type":50,"tag":84,"props":365,"children":366},{"style":284},[367],{"type":55,"value":368},"number",{"type":50,"tag":84,"props":370,"children":371},{"style":103},[372],{"type":55,"value":373},"()",{"type":50,"tag":84,"props":375,"children":376},{"style":97},[377],{"type":55,"value":378},",\n",{"type":50,"tag":84,"props":380,"children":382},{"class":86,"line":381},10,[383,388,392,396,400,405,409],{"type":50,"tag":84,"props":384,"children":385},{"style":347},[386],{"type":55,"value":387},"  text",{"type":50,"tag":84,"props":389,"children":390},{"style":97},[391],{"type":55,"value":355},{"type":50,"tag":84,"props":393,"children":394},{"style":103},[395],{"type":55,"value":225},{"type":50,"tag":84,"props":397,"children":398},{"style":97},[399],{"type":55,"value":325},{"type":50,"tag":84,"props":401,"children":402},{"style":284},[403],{"type":55,"value":404},"string",{"type":50,"tag":84,"props":406,"children":407},{"style":103},[408],{"type":55,"value":373},{"type":50,"tag":84,"props":410,"children":411},{"style":97},[412],{"type":55,"value":378},{"type":50,"tag":84,"props":414,"children":416},{"class":86,"line":415},11,[417,422,426,430,434,439,443,447,452,456,462,467],{"type":50,"tag":84,"props":418,"children":419},{"style":347},[420],{"type":55,"value":421},"  completed",{"type":50,"tag":84,"props":423,"children":424},{"style":97},[425],{"type":55,"value":355},{"type":50,"tag":84,"props":427,"children":428},{"style":103},[429],{"type":55,"value":225},{"type":50,"tag":84,"props":431,"children":432},{"style":97},[433],{"type":55,"value":325},{"type":50,"tag":84,"props":435,"children":436},{"style":284},[437],{"type":55,"value":438},"boolean",{"type":50,"tag":84,"props":440,"children":441},{"style":103},[442],{"type":55,"value":373},{"type":50,"tag":84,"props":444,"children":445},{"style":97},[446],{"type":55,"value":325},{"type":50,"tag":84,"props":448,"children":449},{"style":284},[450],{"type":55,"value":451},"default",{"type":50,"tag":84,"props":453,"children":454},{"style":103},[455],{"type":55,"value":335},{"type":50,"tag":84,"props":457,"children":459},{"style":458},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[460],{"type":55,"value":461},"false",{"type":50,"tag":84,"props":463,"children":464},{"style":103},[465],{"type":55,"value":466},")",{"type":50,"tag":84,"props":468,"children":469},{"style":97},[470],{"type":55,"value":378},{"type":50,"tag":84,"props":472,"children":474},{"class":86,"line":473},12,[475,480,484],{"type":50,"tag":84,"props":476,"children":477},{"style":347},[478],{"type":55,"value":479},"  created_at",{"type":50,"tag":84,"props":481,"children":482},{"style":97},[483],{"type":55,"value":355},{"type":50,"tag":84,"props":485,"children":486},{"style":103},[487],{"type":55,"value":488}," z\n",{"type":50,"tag":84,"props":490,"children":492},{"class":86,"line":491},13,[493,498,503,508,512,516,520,525,529,533,538],{"type":50,"tag":84,"props":494,"children":495},{"style":97},[496],{"type":55,"value":497},"    .",{"type":50,"tag":84,"props":499,"children":500},{"style":284},[501],{"type":55,"value":502},"union",{"type":50,"tag":84,"props":504,"children":505},{"style":103},[506],{"type":55,"value":507},"([z",{"type":50,"tag":84,"props":509,"children":510},{"style":97},[511],{"type":55,"value":325},{"type":50,"tag":84,"props":513,"children":514},{"style":284},[515],{"type":55,"value":404},{"type":50,"tag":84,"props":517,"children":518},{"style":103},[519],{"type":55,"value":373},{"type":50,"tag":84,"props":521,"children":522},{"style":97},[523],{"type":55,"value":524},",",{"type":50,"tag":84,"props":526,"children":527},{"style":103},[528],{"type":55,"value":225},{"type":50,"tag":84,"props":530,"children":531},{"style":97},[532],{"type":55,"value":325},{"type":50,"tag":84,"props":534,"children":535},{"style":284},[536],{"type":55,"value":537},"date",{"type":50,"tag":84,"props":539,"children":540},{"style":103},[541],{"type":55,"value":542},"()])\n",{"type":50,"tag":84,"props":544,"children":546},{"class":86,"line":545},14,[547,551,556,560,564,570,574,579,584,589,594,599,603,607,612,617,621,626,631,635,640],{"type":50,"tag":84,"props":548,"children":549},{"style":97},[550],{"type":55,"value":497},{"type":50,"tag":84,"props":552,"children":553},{"style":284},[554],{"type":55,"value":555},"transform",{"type":50,"tag":84,"props":557,"children":558},{"style":103},[559],{"type":55,"value":335},{"type":50,"tag":84,"props":561,"children":562},{"style":97},[563],{"type":55,"value":335},{"type":50,"tag":84,"props":565,"children":567},{"style":566},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[568],{"type":55,"value":569},"val",{"type":50,"tag":84,"props":571,"children":572},{"style":97},[573],{"type":55,"value":466},{"type":50,"tag":84,"props":575,"children":576},{"style":263},[577],{"type":55,"value":578}," =>",{"type":50,"tag":84,"props":580,"children":581},{"style":103},[582],{"type":55,"value":583}," (",{"type":50,"tag":84,"props":585,"children":586},{"style":97},[587],{"type":55,"value":588},"typeof",{"type":50,"tag":84,"props":590,"children":591},{"style":103},[592],{"type":55,"value":593}," val ",{"type":50,"tag":84,"props":595,"children":596},{"style":97},[597],{"type":55,"value":598},"===",{"type":50,"tag":84,"props":600,"children":601},{"style":97},[602],{"type":55,"value":121},{"type":50,"tag":84,"props":604,"children":605},{"style":124},[606],{"type":55,"value":404},{"type":50,"tag":84,"props":608,"children":609},{"style":97},[610],{"type":55,"value":611},"'",{"type":50,"tag":84,"props":613,"children":614},{"style":97},[615],{"type":55,"value":616}," ?",{"type":50,"tag":84,"props":618,"children":619},{"style":97},[620],{"type":55,"value":281},{"type":50,"tag":84,"props":622,"children":623},{"style":284},[624],{"type":55,"value":625}," Date",{"type":50,"tag":84,"props":627,"children":628},{"style":103},[629],{"type":55,"value":630},"(val) ",{"type":50,"tag":84,"props":632,"children":633},{"style":97},[634],{"type":55,"value":355},{"type":50,"tag":84,"props":636,"children":637},{"style":103},[638],{"type":55,"value":639}," val))",{"type":50,"tag":84,"props":641,"children":642},{"style":97},[643],{"type":55,"value":378},{"type":50,"tag":84,"props":645,"children":647},{"class":86,"line":646},15,[648,653],{"type":50,"tag":84,"props":649,"children":650},{"style":97},[651],{"type":55,"value":652},"}",{"type":50,"tag":84,"props":654,"children":655},{"style":103},[656],{"type":55,"value":657},")\n",{"type":50,"tag":84,"props":659,"children":661},{"class":86,"line":660},16,[662],{"type":50,"tag":84,"props":663,"children":664},{"emptyLinePlaceholder":253},[665],{"type":55,"value":256},{"type":50,"tag":84,"props":667,"children":669},{"class":86,"line":668},17,[670,674,679,683,687],{"type":50,"tag":84,"props":671,"children":672},{"style":263},[673],{"type":55,"value":266},{"type":50,"tag":84,"props":675,"children":676},{"style":103},[677],{"type":55,"value":678}," todoCollection ",{"type":50,"tag":84,"props":680,"children":681},{"style":97},[682],{"type":55,"value":276},{"type":50,"tag":84,"props":684,"children":685},{"style":284},[686],{"type":55,"value":106},{"type":50,"tag":84,"props":688,"children":689},{"style":103},[690],{"type":55,"value":691},"(\n",{"type":50,"tag":84,"props":693,"children":695},{"class":86,"line":694},18,[696,701,705],{"type":50,"tag":84,"props":697,"children":698},{"style":284},[699],{"type":55,"value":700},"  queryCollectionOptions",{"type":50,"tag":84,"props":702,"children":703},{"style":103},[704],{"type":55,"value":335},{"type":50,"tag":84,"props":706,"children":707},{"style":97},[708],{"type":55,"value":340},{"type":50,"tag":84,"props":710,"children":712},{"class":86,"line":711},19,[713,718,722,727,731,736,740,745],{"type":50,"tag":84,"props":714,"children":715},{"style":347},[716],{"type":55,"value":717},"    queryKey",{"type":50,"tag":84,"props":719,"children":720},{"style":97},[721],{"type":55,"value":355},{"type":50,"tag":84,"props":723,"children":724},{"style":103},[725],{"type":55,"value":726}," [",{"type":50,"tag":84,"props":728,"children":729},{"style":97},[730],{"type":55,"value":611},{"type":50,"tag":84,"props":732,"children":733},{"style":124},[734],{"type":55,"value":735},"todos",{"type":50,"tag":84,"props":737,"children":738},{"style":97},[739],{"type":55,"value":611},{"type":50,"tag":84,"props":741,"children":742},{"style":103},[743],{"type":55,"value":744},"]",{"type":50,"tag":84,"props":746,"children":747},{"style":97},[748],{"type":55,"value":378},{"type":50,"tag":84,"props":750,"children":752},{"class":86,"line":751},20,[753,758,762,767,771,776,780,784],{"type":50,"tag":84,"props":754,"children":755},{"style":284},[756],{"type":55,"value":757},"    queryFn",{"type":50,"tag":84,"props":759,"children":760},{"style":97},[761],{"type":55,"value":355},{"type":50,"tag":84,"props":763,"children":764},{"style":263},[765],{"type":55,"value":766}," async",{"type":50,"tag":84,"props":768,"children":769},{"style":97},[770],{"type":55,"value":583},{"type":50,"tag":84,"props":772,"children":773},{"style":566},[774],{"type":55,"value":775},"ctx",{"type":50,"tag":84,"props":777,"children":778},{"style":97},[779],{"type":55,"value":466},{"type":50,"tag":84,"props":781,"children":782},{"style":263},[783],{"type":55,"value":578},{"type":50,"tag":84,"props":785,"children":786},{"style":97},[787],{"type":55,"value":788}," {\n",{"type":50,"tag":84,"props":790,"children":792},{"class":86,"line":791},21,[793,798,803,808,813,818,822,826,831,835,839,843,848,852,857,861,866,870],{"type":50,"tag":84,"props":794,"children":795},{"style":263},[796],{"type":55,"value":797},"      const",{"type":50,"tag":84,"props":799,"children":800},{"style":103},[801],{"type":55,"value":802}," res",{"type":50,"tag":84,"props":804,"children":805},{"style":97},[806],{"type":55,"value":807}," =",{"type":50,"tag":84,"props":809,"children":810},{"style":91},[811],{"type":55,"value":812}," await",{"type":50,"tag":84,"props":814,"children":815},{"style":284},[816],{"type":55,"value":817}," fetch",{"type":50,"tag":84,"props":819,"children":820},{"style":347},[821],{"type":55,"value":335},{"type":50,"tag":84,"props":823,"children":824},{"style":97},[825],{"type":55,"value":611},{"type":50,"tag":84,"props":827,"children":828},{"style":124},[829],{"type":55,"value":830},"\u002Fapi\u002Ftodos",{"type":50,"tag":84,"props":832,"children":833},{"style":97},[834],{"type":55,"value":611},{"type":50,"tag":84,"props":836,"children":837},{"style":97},[838],{"type":55,"value":524},{"type":50,"tag":84,"props":840,"children":841},{"style":97},[842],{"type":55,"value":100},{"type":50,"tag":84,"props":844,"children":845},{"style":347},[846],{"type":55,"value":847}," signal",{"type":50,"tag":84,"props":849,"children":850},{"style":97},[851],{"type":55,"value":355},{"type":50,"tag":84,"props":853,"children":854},{"style":103},[855],{"type":55,"value":856}," ctx",{"type":50,"tag":84,"props":858,"children":859},{"style":97},[860],{"type":55,"value":325},{"type":50,"tag":84,"props":862,"children":863},{"style":103},[864],{"type":55,"value":865},"signal",{"type":50,"tag":84,"props":867,"children":868},{"style":97},[869],{"type":55,"value":111},{"type":50,"tag":84,"props":871,"children":872},{"style":347},[873],{"type":55,"value":657},{"type":50,"tag":84,"props":875,"children":877},{"class":86,"line":876},22,[878,883,887,891,896],{"type":50,"tag":84,"props":879,"children":880},{"style":91},[881],{"type":55,"value":882},"      return",{"type":50,"tag":84,"props":884,"children":885},{"style":103},[886],{"type":55,"value":802},{"type":50,"tag":84,"props":888,"children":889},{"style":97},[890],{"type":55,"value":325},{"type":50,"tag":84,"props":892,"children":893},{"style":284},[894],{"type":55,"value":895},"json",{"type":50,"tag":84,"props":897,"children":898},{"style":347},[899],{"type":55,"value":291},{"type":50,"tag":84,"props":901,"children":903},{"class":86,"line":902},23,[904],{"type":50,"tag":84,"props":905,"children":906},{"style":97},[907],{"type":55,"value":908},"    },\n",{"type":50,"tag":84,"props":910,"children":912},{"class":86,"line":911},24,[913,918],{"type":50,"tag":84,"props":914,"children":915},{"style":103},[916],{"type":55,"value":917},"    queryClient",{"type":50,"tag":84,"props":919,"children":920},{"style":97},[921],{"type":55,"value":378},{"type":50,"tag":84,"props":923,"children":925},{"class":86,"line":924},25,[926,931,935,939,944,948,952,957,961,966],{"type":50,"tag":84,"props":927,"children":928},{"style":284},[929],{"type":55,"value":930},"    getKey",{"type":50,"tag":84,"props":932,"children":933},{"style":97},[934],{"type":55,"value":355},{"type":50,"tag":84,"props":936,"children":937},{"style":97},[938],{"type":55,"value":583},{"type":50,"tag":84,"props":940,"children":941},{"style":566},[942],{"type":55,"value":943},"item",{"type":50,"tag":84,"props":945,"children":946},{"style":97},[947],{"type":55,"value":466},{"type":50,"tag":84,"props":949,"children":950},{"style":263},[951],{"type":55,"value":578},{"type":50,"tag":84,"props":953,"children":954},{"style":103},[955],{"type":55,"value":956}," item",{"type":50,"tag":84,"props":958,"children":959},{"style":97},[960],{"type":55,"value":325},{"type":50,"tag":84,"props":962,"children":963},{"style":103},[964],{"type":55,"value":965},"id",{"type":50,"tag":84,"props":967,"children":968},{"style":97},[969],{"type":55,"value":378},{"type":50,"tag":84,"props":971,"children":973},{"class":86,"line":972},26,[974,979,983,988],{"type":50,"tag":84,"props":975,"children":976},{"style":347},[977],{"type":55,"value":978},"    schema",{"type":50,"tag":84,"props":980,"children":981},{"style":97},[982],{"type":55,"value":355},{"type":50,"tag":84,"props":984,"children":985},{"style":103},[986],{"type":55,"value":987}," todoSchema",{"type":50,"tag":84,"props":989,"children":990},{"style":97},[991],{"type":55,"value":378},{"type":50,"tag":84,"props":993,"children":995},{"class":86,"line":994},27,[996,1001,1005,1009,1014,1019,1024,1028],{"type":50,"tag":84,"props":997,"children":998},{"style":284},[999],{"type":55,"value":1000},"    onInsert",{"type":50,"tag":84,"props":1002,"children":1003},{"style":97},[1004],{"type":55,"value":355},{"type":50,"tag":84,"props":1006,"children":1007},{"style":263},[1008],{"type":55,"value":766},{"type":50,"tag":84,"props":1010,"children":1011},{"style":97},[1012],{"type":55,"value":1013}," ({",{"type":50,"tag":84,"props":1015,"children":1016},{"style":566},[1017],{"type":55,"value":1018}," transaction",{"type":50,"tag":84,"props":1020,"children":1021},{"style":97},[1022],{"type":55,"value":1023}," })",{"type":50,"tag":84,"props":1025,"children":1026},{"style":263},[1027],{"type":55,"value":578},{"type":50,"tag":84,"props":1029,"children":1030},{"style":97},[1031],{"type":55,"value":788},{"type":50,"tag":84,"props":1033,"children":1035},{"class":86,"line":1034},28,[1036,1041,1046,1050,1054,1058,1063,1067,1072,1076,1081,1086,1092,1096,1100,1105],{"type":50,"tag":84,"props":1037,"children":1038},{"style":91},[1039],{"type":55,"value":1040},"      await",{"type":50,"tag":84,"props":1042,"children":1043},{"style":103},[1044],{"type":55,"value":1045}," api",{"type":50,"tag":84,"props":1047,"children":1048},{"style":97},[1049],{"type":55,"value":325},{"type":50,"tag":84,"props":1051,"children":1052},{"style":103},[1053],{"type":55,"value":735},{"type":50,"tag":84,"props":1055,"children":1056},{"style":97},[1057],{"type":55,"value":325},{"type":50,"tag":84,"props":1059,"children":1060},{"style":284},[1061],{"type":55,"value":1062},"create",{"type":50,"tag":84,"props":1064,"children":1065},{"style":347},[1066],{"type":55,"value":335},{"type":50,"tag":84,"props":1068,"children":1069},{"style":103},[1070],{"type":55,"value":1071},"transaction",{"type":50,"tag":84,"props":1073,"children":1074},{"style":97},[1075],{"type":55,"value":325},{"type":50,"tag":84,"props":1077,"children":1078},{"style":103},[1079],{"type":55,"value":1080},"mutations",{"type":50,"tag":84,"props":1082,"children":1083},{"style":347},[1084],{"type":55,"value":1085},"[",{"type":50,"tag":84,"props":1087,"children":1089},{"style":1088},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1090],{"type":55,"value":1091},"0",{"type":50,"tag":84,"props":1093,"children":1094},{"style":347},[1095],{"type":55,"value":744},{"type":50,"tag":84,"props":1097,"children":1098},{"style":97},[1099],{"type":55,"value":325},{"type":50,"tag":84,"props":1101,"children":1102},{"style":103},[1103],{"type":55,"value":1104},"modified",{"type":50,"tag":84,"props":1106,"children":1107},{"style":347},[1108],{"type":55,"value":657},{"type":50,"tag":84,"props":1110,"children":1112},{"class":86,"line":1111},29,[1113],{"type":50,"tag":84,"props":1114,"children":1115},{"style":97},[1116],{"type":55,"value":908},{"type":50,"tag":84,"props":1118,"children":1120},{"class":86,"line":1119},30,[1121,1126,1130,1134,1138,1142,1146,1150],{"type":50,"tag":84,"props":1122,"children":1123},{"style":284},[1124],{"type":55,"value":1125},"    onUpdate",{"type":50,"tag":84,"props":1127,"children":1128},{"style":97},[1129],{"type":55,"value":355},{"type":50,"tag":84,"props":1131,"children":1132},{"style":263},[1133],{"type":55,"value":766},{"type":50,"tag":84,"props":1135,"children":1136},{"style":97},[1137],{"type":55,"value":1013},{"type":50,"tag":84,"props":1139,"children":1140},{"style":566},[1141],{"type":55,"value":1018},{"type":50,"tag":84,"props":1143,"children":1144},{"style":97},[1145],{"type":55,"value":1023},{"type":50,"tag":84,"props":1147,"children":1148},{"style":263},[1149],{"type":55,"value":578},{"type":50,"tag":84,"props":1151,"children":1152},{"style":97},[1153],{"type":55,"value":788},{"type":50,"tag":84,"props":1155,"children":1157},{"class":86,"line":1156},31,[1158,1162,1167,1171,1175,1179,1183,1187,1191],{"type":50,"tag":84,"props":1159,"children":1160},{"style":263},[1161],{"type":55,"value":797},{"type":50,"tag":84,"props":1163,"children":1164},{"style":103},[1165],{"type":55,"value":1166}," mut",{"type":50,"tag":84,"props":1168,"children":1169},{"style":97},[1170],{"type":55,"value":807},{"type":50,"tag":84,"props":1172,"children":1173},{"style":103},[1174],{"type":55,"value":1018},{"type":50,"tag":84,"props":1176,"children":1177},{"style":97},[1178],{"type":55,"value":325},{"type":50,"tag":84,"props":1180,"children":1181},{"style":103},[1182],{"type":55,"value":1080},{"type":50,"tag":84,"props":1184,"children":1185},{"style":347},[1186],{"type":55,"value":1085},{"type":50,"tag":84,"props":1188,"children":1189},{"style":1088},[1190],{"type":55,"value":1091},{"type":50,"tag":84,"props":1192,"children":1193},{"style":347},[1194],{"type":55,"value":1195},"]\n",{"type":50,"tag":84,"props":1197,"children":1199},{"class":86,"line":1198},32,[1200,1204,1208,1212,1216,1220,1225,1229,1234,1238,1243,1247,1251,1255,1260],{"type":50,"tag":84,"props":1201,"children":1202},{"style":91},[1203],{"type":55,"value":1040},{"type":50,"tag":84,"props":1205,"children":1206},{"style":103},[1207],{"type":55,"value":1045},{"type":50,"tag":84,"props":1209,"children":1210},{"style":97},[1211],{"type":55,"value":325},{"type":50,"tag":84,"props":1213,"children":1214},{"style":103},[1215],{"type":55,"value":735},{"type":50,"tag":84,"props":1217,"children":1218},{"style":97},[1219],{"type":55,"value":325},{"type":50,"tag":84,"props":1221,"children":1222},{"style":284},[1223],{"type":55,"value":1224},"update",{"type":50,"tag":84,"props":1226,"children":1227},{"style":347},[1228],{"type":55,"value":335},{"type":50,"tag":84,"props":1230,"children":1231},{"style":103},[1232],{"type":55,"value":1233},"mut",{"type":50,"tag":84,"props":1235,"children":1236},{"style":97},[1237],{"type":55,"value":325},{"type":50,"tag":84,"props":1239,"children":1240},{"style":103},[1241],{"type":55,"value":1242},"key",{"type":50,"tag":84,"props":1244,"children":1245},{"style":97},[1246],{"type":55,"value":524},{"type":50,"tag":84,"props":1248,"children":1249},{"style":103},[1250],{"type":55,"value":1166},{"type":50,"tag":84,"props":1252,"children":1253},{"style":97},[1254],{"type":55,"value":325},{"type":50,"tag":84,"props":1256,"children":1257},{"style":103},[1258],{"type":55,"value":1259},"changes",{"type":50,"tag":84,"props":1261,"children":1262},{"style":347},[1263],{"type":55,"value":657},{"type":50,"tag":84,"props":1265,"children":1267},{"class":86,"line":1266},33,[1268],{"type":50,"tag":84,"props":1269,"children":1270},{"style":97},[1271],{"type":55,"value":908},{"type":50,"tag":84,"props":1273,"children":1275},{"class":86,"line":1274},34,[1276,1281,1285,1289,1293,1297,1301,1305],{"type":50,"tag":84,"props":1277,"children":1278},{"style":284},[1279],{"type":55,"value":1280},"    onDelete",{"type":50,"tag":84,"props":1282,"children":1283},{"style":97},[1284],{"type":55,"value":355},{"type":50,"tag":84,"props":1286,"children":1287},{"style":263},[1288],{"type":55,"value":766},{"type":50,"tag":84,"props":1290,"children":1291},{"style":97},[1292],{"type":55,"value":1013},{"type":50,"tag":84,"props":1294,"children":1295},{"style":566},[1296],{"type":55,"value":1018},{"type":50,"tag":84,"props":1298,"children":1299},{"style":97},[1300],{"type":55,"value":1023},{"type":50,"tag":84,"props":1302,"children":1303},{"style":263},[1304],{"type":55,"value":578},{"type":50,"tag":84,"props":1306,"children":1307},{"style":97},[1308],{"type":55,"value":788},{"type":50,"tag":84,"props":1310,"children":1312},{"class":86,"line":1311},35,[1313,1317,1321,1325,1329,1333,1338,1342,1346,1350,1354,1358,1362,1366,1370,1374],{"type":50,"tag":84,"props":1314,"children":1315},{"style":91},[1316],{"type":55,"value":1040},{"type":50,"tag":84,"props":1318,"children":1319},{"style":103},[1320],{"type":55,"value":1045},{"type":50,"tag":84,"props":1322,"children":1323},{"style":97},[1324],{"type":55,"value":325},{"type":50,"tag":84,"props":1326,"children":1327},{"style":103},[1328],{"type":55,"value":735},{"type":50,"tag":84,"props":1330,"children":1331},{"style":97},[1332],{"type":55,"value":325},{"type":50,"tag":84,"props":1334,"children":1335},{"style":284},[1336],{"type":55,"value":1337},"delete",{"type":50,"tag":84,"props":1339,"children":1340},{"style":347},[1341],{"type":55,"value":335},{"type":50,"tag":84,"props":1343,"children":1344},{"style":103},[1345],{"type":55,"value":1071},{"type":50,"tag":84,"props":1347,"children":1348},{"style":97},[1349],{"type":55,"value":325},{"type":50,"tag":84,"props":1351,"children":1352},{"style":103},[1353],{"type":55,"value":1080},{"type":50,"tag":84,"props":1355,"children":1356},{"style":347},[1357],{"type":55,"value":1085},{"type":50,"tag":84,"props":1359,"children":1360},{"style":1088},[1361],{"type":55,"value":1091},{"type":50,"tag":84,"props":1363,"children":1364},{"style":347},[1365],{"type":55,"value":744},{"type":50,"tag":84,"props":1367,"children":1368},{"style":97},[1369],{"type":55,"value":325},{"type":50,"tag":84,"props":1371,"children":1372},{"style":103},[1373],{"type":55,"value":1242},{"type":50,"tag":84,"props":1375,"children":1376},{"style":347},[1377],{"type":55,"value":657},{"type":50,"tag":84,"props":1379,"children":1381},{"class":86,"line":1380},36,[1382],{"type":50,"tag":84,"props":1383,"children":1384},{"style":97},[1385],{"type":55,"value":908},{"type":50,"tag":84,"props":1387,"children":1389},{"class":86,"line":1388},37,[1390,1395,1399],{"type":50,"tag":84,"props":1391,"children":1392},{"style":97},[1393],{"type":55,"value":1394},"  }",{"type":50,"tag":84,"props":1396,"children":1397},{"style":103},[1398],{"type":55,"value":466},{"type":50,"tag":84,"props":1400,"children":1401},{"style":97},[1402],{"type":55,"value":378},{"type":50,"tag":84,"props":1404,"children":1406},{"class":86,"line":1405},38,[1407],{"type":50,"tag":84,"props":1408,"children":1409},{"style":103},[1410],{"type":55,"value":657},{"type":50,"tag":65,"props":1412,"children":1414},{"id":1413},"choosing-an-adapter",[1415],{"type":55,"value":1416},"Choosing an Adapter",{"type":50,"tag":1418,"props":1419,"children":1420},"table",{},[1421,1445],{"type":50,"tag":1422,"props":1423,"children":1424},"thead",{},[1425],{"type":50,"tag":1426,"props":1427,"children":1428},"tr",{},[1429,1435,1440],{"type":50,"tag":1430,"props":1431,"children":1432},"th",{},[1433],{"type":55,"value":1434},"Backend",{"type":50,"tag":1430,"props":1436,"children":1437},{},[1438],{"type":55,"value":1439},"Adapter",{"type":50,"tag":1430,"props":1441,"children":1442},{},[1443],{"type":55,"value":1444},"Package",{"type":50,"tag":1446,"props":1447,"children":1448},"tbody",{},[1449,1475,1501,1527,1553,1579,1605],{"type":50,"tag":1426,"props":1450,"children":1451},{},[1452,1458,1467],{"type":50,"tag":1453,"props":1454,"children":1455},"td",{},[1456],{"type":55,"value":1457},"REST API \u002F TanStack Query",{"type":50,"tag":1453,"props":1459,"children":1460},{},[1461],{"type":50,"tag":80,"props":1462,"children":1464},{"className":1463},[],[1465],{"type":55,"value":1466},"queryCollectionOptions",{"type":50,"tag":1453,"props":1468,"children":1469},{},[1470],{"type":50,"tag":80,"props":1471,"children":1473},{"className":1472},[],[1474],{"type":55,"value":166},{"type":50,"tag":1426,"props":1476,"children":1477},{},[1478,1483,1492],{"type":50,"tag":1453,"props":1479,"children":1480},{},[1481],{"type":55,"value":1482},"ElectricSQL (real-time Postgres)",{"type":50,"tag":1453,"props":1484,"children":1485},{},[1486],{"type":50,"tag":80,"props":1487,"children":1489},{"className":1488},[],[1490],{"type":55,"value":1491},"electricCollectionOptions",{"type":50,"tag":1453,"props":1493,"children":1494},{},[1495],{"type":50,"tag":80,"props":1496,"children":1498},{"className":1497},[],[1499],{"type":55,"value":1500},"@tanstack\u002Felectric-db-collection",{"type":50,"tag":1426,"props":1502,"children":1503},{},[1504,1509,1518],{"type":50,"tag":1453,"props":1505,"children":1506},{},[1507],{"type":55,"value":1508},"PowerSync (SQLite offline)",{"type":50,"tag":1453,"props":1510,"children":1511},{},[1512],{"type":50,"tag":80,"props":1513,"children":1515},{"className":1514},[],[1516],{"type":55,"value":1517},"powerSyncCollectionOptions",{"type":50,"tag":1453,"props":1519,"children":1520},{},[1521],{"type":50,"tag":80,"props":1522,"children":1524},{"className":1523},[],[1525],{"type":55,"value":1526},"@tanstack\u002Fpowersync-db-collection",{"type":50,"tag":1426,"props":1528,"children":1529},{},[1530,1535,1544],{"type":50,"tag":1453,"props":1531,"children":1532},{},[1533],{"type":55,"value":1534},"RxDB (reactive database)",{"type":50,"tag":1453,"props":1536,"children":1537},{},[1538],{"type":50,"tag":80,"props":1539,"children":1541},{"className":1540},[],[1542],{"type":55,"value":1543},"rxdbCollectionOptions",{"type":50,"tag":1453,"props":1545,"children":1546},{},[1547],{"type":50,"tag":80,"props":1548,"children":1550},{"className":1549},[],[1551],{"type":55,"value":1552},"@tanstack\u002Frxdb-db-collection",{"type":50,"tag":1426,"props":1554,"children":1555},{},[1556,1561,1570],{"type":50,"tag":1453,"props":1557,"children":1558},{},[1559],{"type":55,"value":1560},"TrailBase (event streaming)",{"type":50,"tag":1453,"props":1562,"children":1563},{},[1564],{"type":50,"tag":80,"props":1565,"children":1567},{"className":1566},[],[1568],{"type":55,"value":1569},"trailbaseCollectionOptions",{"type":50,"tag":1453,"props":1571,"children":1572},{},[1573],{"type":50,"tag":80,"props":1574,"children":1576},{"className":1575},[],[1577],{"type":55,"value":1578},"@tanstack\u002Ftrailbase-db-collection",{"type":50,"tag":1426,"props":1580,"children":1581},{},[1582,1587,1596],{"type":50,"tag":1453,"props":1583,"children":1584},{},[1585],{"type":55,"value":1586},"No backend (UI state)",{"type":50,"tag":1453,"props":1588,"children":1589},{},[1590],{"type":50,"tag":80,"props":1591,"children":1593},{"className":1592},[],[1594],{"type":55,"value":1595},"localOnlyCollectionOptions",{"type":50,"tag":1453,"props":1597,"children":1598},{},[1599],{"type":50,"tag":80,"props":1600,"children":1602},{"className":1601},[],[1603],{"type":55,"value":1604},"@tanstack\u002Fdb",{"type":50,"tag":1426,"props":1606,"children":1607},{},[1608,1613,1622],{"type":50,"tag":1453,"props":1609,"children":1610},{},[1611],{"type":55,"value":1612},"Browser localStorage",{"type":50,"tag":1453,"props":1614,"children":1615},{},[1616],{"type":50,"tag":80,"props":1617,"children":1619},{"className":1618},[],[1620],{"type":55,"value":1621},"localStorageCollectionOptions",{"type":50,"tag":1453,"props":1623,"children":1624},{},[1625],{"type":50,"tag":80,"props":1626,"children":1628},{"className":1627},[],[1629],{"type":55,"value":1604},{"type":50,"tag":51,"props":1631,"children":1632},{},[1633,1635,1640],{"type":55,"value":1634},"If the user specifies a backend (e.g. Electric, PowerSync), use that adapter directly. Only use ",{"type":50,"tag":80,"props":1636,"children":1638},{"className":1637},[],[1639],{"type":55,"value":1595},{"type":55,"value":1641}," when there is no backend yet — the collection API is uniform, so swapping to a real adapter later only changes the options creator.",{"type":50,"tag":65,"props":1643,"children":1645},{"id":1644},"sync-modes",[1646],{"type":55,"value":1647},"Sync Modes",{"type":50,"tag":72,"props":1649,"children":1651},{"className":74,"code":1650,"language":76,"meta":77,"style":77},"queryCollectionOptions({\n  syncMode: 'eager', \u002F\u002F default — loads all data upfront\n  \u002F\u002F syncMode: \"on-demand\", \u002F\u002F loads only what live queries request\n  \u002F\u002F syncMode: \"progressive\", \u002F\u002F (Electric only) query subset first, full sync in background\n})\n",[1652],{"type":50,"tag":80,"props":1653,"children":1654},{"__ignoreMap":77},[1655,1670,1705,1718,1731],{"type":50,"tag":84,"props":1656,"children":1657},{"class":86,"line":87},[1658,1662,1666],{"type":50,"tag":84,"props":1659,"children":1660},{"style":284},[1661],{"type":55,"value":1466},{"type":50,"tag":84,"props":1663,"children":1664},{"style":103},[1665],{"type":55,"value":335},{"type":50,"tag":84,"props":1667,"children":1668},{"style":97},[1669],{"type":55,"value":340},{"type":50,"tag":84,"props":1671,"children":1672},{"class":86,"line":135},[1673,1678,1682,1686,1691,1695,1699],{"type":50,"tag":84,"props":1674,"children":1675},{"style":347},[1676],{"type":55,"value":1677},"  syncMode",{"type":50,"tag":84,"props":1679,"children":1680},{"style":97},[1681],{"type":55,"value":355},{"type":50,"tag":84,"props":1683,"children":1684},{"style":97},[1685],{"type":55,"value":121},{"type":50,"tag":84,"props":1687,"children":1688},{"style":124},[1689],{"type":55,"value":1690},"eager",{"type":50,"tag":84,"props":1692,"children":1693},{"style":97},[1694],{"type":55,"value":611},{"type":50,"tag":84,"props":1696,"children":1697},{"style":97},[1698],{"type":55,"value":524},{"type":50,"tag":84,"props":1700,"children":1702},{"style":1701},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[1703],{"type":55,"value":1704}," \u002F\u002F default — loads all data upfront\n",{"type":50,"tag":84,"props":1706,"children":1707},{"class":86,"line":173},[1708,1713],{"type":50,"tag":84,"props":1709,"children":1710},{"style":1701},[1711],{"type":55,"value":1712},"  \u002F\u002F syncMode: \"on-demand\",",{"type":50,"tag":84,"props":1714,"children":1715},{"style":1701},[1716],{"type":55,"value":1717}," \u002F\u002F loads only what live queries request\n",{"type":50,"tag":84,"props":1719,"children":1720},{"class":86,"line":211},[1721,1726],{"type":50,"tag":84,"props":1722,"children":1723},{"style":1701},[1724],{"type":55,"value":1725},"  \u002F\u002F syncMode: \"progressive\",",{"type":50,"tag":84,"props":1727,"children":1728},{"style":1701},[1729],{"type":55,"value":1730}," \u002F\u002F (Electric only) query subset first, full sync in background\n",{"type":50,"tag":84,"props":1732,"children":1733},{"class":86,"line":249},[1734,1738],{"type":50,"tag":84,"props":1735,"children":1736},{"style":97},[1737],{"type":55,"value":652},{"type":50,"tag":84,"props":1739,"children":1740},{"style":103},[1741],{"type":55,"value":657},{"type":50,"tag":1418,"props":1743,"children":1744},{},[1745,1766],{"type":50,"tag":1422,"props":1746,"children":1747},{},[1748],{"type":50,"tag":1426,"props":1749,"children":1750},{},[1751,1756,1761],{"type":50,"tag":1430,"props":1752,"children":1753},{},[1754],{"type":55,"value":1755},"Mode",{"type":50,"tag":1430,"props":1757,"children":1758},{},[1759],{"type":55,"value":1760},"Best for",{"type":50,"tag":1430,"props":1762,"children":1763},{},[1764],{"type":55,"value":1765},"Data size",{"type":50,"tag":1446,"props":1767,"children":1768},{},[1769,1790,1812],{"type":50,"tag":1426,"props":1770,"children":1771},{},[1772,1780,1785],{"type":50,"tag":1453,"props":1773,"children":1774},{},[1775],{"type":50,"tag":80,"props":1776,"children":1778},{"className":1777},[],[1779],{"type":55,"value":1690},{"type":50,"tag":1453,"props":1781,"children":1782},{},[1783],{"type":55,"value":1784},"Mostly-static datasets",{"type":50,"tag":1453,"props":1786,"children":1787},{},[1788],{"type":55,"value":1789},"\u003C10k rows",{"type":50,"tag":1426,"props":1791,"children":1792},{},[1793,1802,1807],{"type":50,"tag":1453,"props":1794,"children":1795},{},[1796],{"type":50,"tag":80,"props":1797,"children":1799},{"className":1798},[],[1800],{"type":55,"value":1801},"on-demand",{"type":50,"tag":1453,"props":1803,"children":1804},{},[1805],{"type":55,"value":1806},"Search, catalogs, large tables",{"type":50,"tag":1453,"props":1808,"children":1809},{},[1810],{"type":55,"value":1811},">50k rows",{"type":50,"tag":1426,"props":1813,"children":1814},{},[1815,1824,1829],{"type":50,"tag":1453,"props":1816,"children":1817},{},[1818],{"type":50,"tag":80,"props":1819,"children":1821},{"className":1820},[],[1822],{"type":55,"value":1823},"progressive",{"type":50,"tag":1453,"props":1825,"children":1826},{},[1827],{"type":55,"value":1828},"Collaborative apps needing instant first paint (Electric only)",{"type":50,"tag":1453,"props":1830,"children":1831},{},[1832],{"type":55,"value":1833},"Any",{"type":50,"tag":51,"props":1835,"children":1836},{},[1837,1839,1845,1847,1853],{"type":55,"value":1838},"Calling ",{"type":50,"tag":80,"props":1840,"children":1842},{"className":1841},[],[1843],{"type":55,"value":1844},"collection.preload()",{"type":55,"value":1846}," on an on-demand collection is a no-op. Create\nthe live query for the required subset and call ",{"type":50,"tag":80,"props":1848,"children":1850},{"className":1849},[],[1851],{"type":55,"value":1852},"liveQuery.preload()",{"type":55,"value":1854}," instead.",{"type":50,"tag":51,"props":1856,"children":1857},{},[1858,1860,1866,1868,1875],{"type":55,"value":1859},"For Query Collection request cancellation, cleanup boundaries, and shared\n",{"type":50,"tag":80,"props":1861,"children":1863},{"className":1862},[],[1864],{"type":55,"value":1865},"QueryClient",{"type":55,"value":1867}," behavior, read\n",{"type":50,"tag":1869,"props":1870,"children":1872},"a",{"href":1871},"references\u002Fquery-adapter.md#request-cancellation-and-cleanup",[1873],{"type":55,"value":1874},"the Query adapter reference",{"type":55,"value":325},{"type":50,"tag":65,"props":1877,"children":1879},{"id":1878},"indexing",[1880],{"type":55,"value":1881},"Indexing",{"type":50,"tag":51,"props":1883,"children":1884},{},[1885,1887,1893,1895,1901,1903,1909,1911,1917],{"type":55,"value":1886},"Indexing is opt-in. The ",{"type":50,"tag":80,"props":1888,"children":1890},{"className":1889},[],[1891],{"type":55,"value":1892},"autoIndex",{"type":55,"value":1894}," option defaults to ",{"type":50,"tag":80,"props":1896,"children":1898},{"className":1897},[],[1899],{"type":55,"value":1900},"\"off\"",{"type":55,"value":1902},". To enable automatic indexing, set ",{"type":50,"tag":80,"props":1904,"children":1906},{"className":1905},[],[1907],{"type":55,"value":1908},"autoIndex: \"eager\"",{"type":55,"value":1910}," and provide a ",{"type":50,"tag":80,"props":1912,"children":1914},{"className":1913},[],[1915],{"type":55,"value":1916},"defaultIndexType",{"type":55,"value":355},{"type":50,"tag":72,"props":1919,"children":1921},{"className":74,"code":1920,"language":76,"meta":77,"style":77},"import { BasicIndex } from '@tanstack\u002Fdb'\n\ncreateCollection(\n  queryCollectionOptions({\n    autoIndex: 'eager',\n    defaultIndexType: BasicIndex,\n    \u002F\u002F ...\n  }),\n)\n",[1922],{"type":50,"tag":80,"props":1923,"children":1924},{"__ignoreMap":77},[1925,1961,1968,1980,1995,2023,2043,2051,2066],{"type":50,"tag":84,"props":1926,"children":1927},{"class":86,"line":87},[1928,1932,1936,1941,1945,1949,1953,1957],{"type":50,"tag":84,"props":1929,"children":1930},{"style":91},[1931],{"type":55,"value":94},{"type":50,"tag":84,"props":1933,"children":1934},{"style":97},[1935],{"type":55,"value":100},{"type":50,"tag":84,"props":1937,"children":1938},{"style":103},[1939],{"type":55,"value":1940}," BasicIndex",{"type":50,"tag":84,"props":1942,"children":1943},{"style":97},[1944],{"type":55,"value":111},{"type":50,"tag":84,"props":1946,"children":1947},{"style":91},[1948],{"type":55,"value":116},{"type":50,"tag":84,"props":1950,"children":1951},{"style":97},[1952],{"type":55,"value":121},{"type":50,"tag":84,"props":1954,"children":1955},{"style":124},[1956],{"type":55,"value":1604},{"type":50,"tag":84,"props":1958,"children":1959},{"style":97},[1960],{"type":55,"value":132},{"type":50,"tag":84,"props":1962,"children":1963},{"class":86,"line":135},[1964],{"type":50,"tag":84,"props":1965,"children":1966},{"emptyLinePlaceholder":253},[1967],{"type":55,"value":256},{"type":50,"tag":84,"props":1969,"children":1970},{"class":86,"line":173},[1971,1976],{"type":50,"tag":84,"props":1972,"children":1973},{"style":284},[1974],{"type":55,"value":1975},"createCollection",{"type":50,"tag":84,"props":1977,"children":1978},{"style":103},[1979],{"type":55,"value":691},{"type":50,"tag":84,"props":1981,"children":1982},{"class":86,"line":211},[1983,1987,1991],{"type":50,"tag":84,"props":1984,"children":1985},{"style":284},[1986],{"type":55,"value":700},{"type":50,"tag":84,"props":1988,"children":1989},{"style":103},[1990],{"type":55,"value":335},{"type":50,"tag":84,"props":1992,"children":1993},{"style":97},[1994],{"type":55,"value":340},{"type":50,"tag":84,"props":1996,"children":1997},{"class":86,"line":249},[1998,2003,2007,2011,2015,2019],{"type":50,"tag":84,"props":1999,"children":2000},{"style":347},[2001],{"type":55,"value":2002},"    autoIndex",{"type":50,"tag":84,"props":2004,"children":2005},{"style":97},[2006],{"type":55,"value":355},{"type":50,"tag":84,"props":2008,"children":2009},{"style":97},[2010],{"type":55,"value":121},{"type":50,"tag":84,"props":2012,"children":2013},{"style":124},[2014],{"type":55,"value":1690},{"type":50,"tag":84,"props":2016,"children":2017},{"style":97},[2018],{"type":55,"value":611},{"type":50,"tag":84,"props":2020,"children":2021},{"style":97},[2022],{"type":55,"value":378},{"type":50,"tag":84,"props":2024,"children":2025},{"class":86,"line":259},[2026,2031,2035,2039],{"type":50,"tag":84,"props":2027,"children":2028},{"style":347},[2029],{"type":55,"value":2030},"    defaultIndexType",{"type":50,"tag":84,"props":2032,"children":2033},{"style":97},[2034],{"type":55,"value":355},{"type":50,"tag":84,"props":2036,"children":2037},{"style":103},[2038],{"type":55,"value":1940},{"type":50,"tag":84,"props":2040,"children":2041},{"style":97},[2042],{"type":55,"value":378},{"type":50,"tag":84,"props":2044,"children":2045},{"class":86,"line":294},[2046],{"type":50,"tag":84,"props":2047,"children":2048},{"style":1701},[2049],{"type":55,"value":2050},"    \u002F\u002F ...\n",{"type":50,"tag":84,"props":2052,"children":2053},{"class":86,"line":302},[2054,2058,2062],{"type":50,"tag":84,"props":2055,"children":2056},{"style":97},[2057],{"type":55,"value":1394},{"type":50,"tag":84,"props":2059,"children":2060},{"style":103},[2061],{"type":55,"value":466},{"type":50,"tag":84,"props":2063,"children":2064},{"style":97},[2065],{"type":55,"value":378},{"type":50,"tag":84,"props":2067,"children":2068},{"class":86,"line":343},[2069],{"type":50,"tag":84,"props":2070,"children":2071},{"style":103},[2072],{"type":55,"value":657},{"type":50,"tag":51,"props":2074,"children":2075},{},[2076,2078,2083,2085,2090,2092,2098,2100,2106,2108,2114],{"type":55,"value":2077},"Without ",{"type":50,"tag":80,"props":2079,"children":2081},{"className":2080},[],[2082],{"type":55,"value":1916},{"type":55,"value":2084},", setting ",{"type":50,"tag":80,"props":2086,"children":2088},{"className":2087},[],[2089],{"type":55,"value":1908},{"type":55,"value":2091}," throws a ",{"type":50,"tag":80,"props":2093,"children":2095},{"className":2094},[],[2096],{"type":55,"value":2097},"CollectionConfigurationError",{"type":55,"value":2099},". You can also create indexes manually with ",{"type":50,"tag":80,"props":2101,"children":2103},{"className":2102},[],[2104],{"type":55,"value":2105},"collection.createIndex()",{"type":55,"value":2107}," and remove them with ",{"type":50,"tag":80,"props":2109,"children":2111},{"className":2110},[],[2112],{"type":55,"value":2113},"collection.removeIndex()",{"type":55,"value":325},{"type":50,"tag":65,"props":2116,"children":2118},{"id":2117},"core-patterns",[2119],{"type":55,"value":2120},"Core Patterns",{"type":50,"tag":2122,"props":2123,"children":2125},"h3",{"id":2124},"local-only-collection-for-prototyping",[2126],{"type":55,"value":2127},"Local-only collection for prototyping",{"type":50,"tag":72,"props":2129,"children":2131},{"className":74,"code":2130,"language":76,"meta":77,"style":77},"import {\n  createCollection,\n  localOnlyCollectionOptions,\n} from '@tanstack\u002Freact-db'\n\nconst todoCollection = createCollection(\n  localOnlyCollectionOptions({\n    getKey: (item) => item.id,\n    initialData: [{ id: 1, text: 'Learn TanStack DB', completed: false }],\n  }),\n)\n",[2132],{"type":50,"tag":80,"props":2133,"children":2134},{"__ignoreMap":77},[2135,2146,2158,2170,2193,2200,2223,2238,2281,2372,2387],{"type":50,"tag":84,"props":2136,"children":2137},{"class":86,"line":87},[2138,2142],{"type":50,"tag":84,"props":2139,"children":2140},{"style":91},[2141],{"type":55,"value":94},{"type":50,"tag":84,"props":2143,"children":2144},{"style":97},[2145],{"type":55,"value":788},{"type":50,"tag":84,"props":2147,"children":2148},{"class":86,"line":135},[2149,2154],{"type":50,"tag":84,"props":2150,"children":2151},{"style":103},[2152],{"type":55,"value":2153},"  createCollection",{"type":50,"tag":84,"props":2155,"children":2156},{"style":97},[2157],{"type":55,"value":378},{"type":50,"tag":84,"props":2159,"children":2160},{"class":86,"line":173},[2161,2166],{"type":50,"tag":84,"props":2162,"children":2163},{"style":103},[2164],{"type":55,"value":2165},"  localOnlyCollectionOptions",{"type":50,"tag":84,"props":2167,"children":2168},{"style":97},[2169],{"type":55,"value":378},{"type":50,"tag":84,"props":2171,"children":2172},{"class":86,"line":211},[2173,2177,2181,2185,2189],{"type":50,"tag":84,"props":2174,"children":2175},{"style":97},[2176],{"type":55,"value":652},{"type":50,"tag":84,"props":2178,"children":2179},{"style":91},[2180],{"type":55,"value":116},{"type":50,"tag":84,"props":2182,"children":2183},{"style":97},[2184],{"type":55,"value":121},{"type":50,"tag":84,"props":2186,"children":2187},{"style":124},[2188],{"type":55,"value":127},{"type":50,"tag":84,"props":2190,"children":2191},{"style":97},[2192],{"type":55,"value":132},{"type":50,"tag":84,"props":2194,"children":2195},{"class":86,"line":249},[2196],{"type":50,"tag":84,"props":2197,"children":2198},{"emptyLinePlaceholder":253},[2199],{"type":55,"value":256},{"type":50,"tag":84,"props":2201,"children":2202},{"class":86,"line":259},[2203,2207,2211,2215,2219],{"type":50,"tag":84,"props":2204,"children":2205},{"style":263},[2206],{"type":55,"value":266},{"type":50,"tag":84,"props":2208,"children":2209},{"style":103},[2210],{"type":55,"value":678},{"type":50,"tag":84,"props":2212,"children":2213},{"style":97},[2214],{"type":55,"value":276},{"type":50,"tag":84,"props":2216,"children":2217},{"style":284},[2218],{"type":55,"value":106},{"type":50,"tag":84,"props":2220,"children":2221},{"style":103},[2222],{"type":55,"value":691},{"type":50,"tag":84,"props":2224,"children":2225},{"class":86,"line":294},[2226,2230,2234],{"type":50,"tag":84,"props":2227,"children":2228},{"style":284},[2229],{"type":55,"value":2165},{"type":50,"tag":84,"props":2231,"children":2232},{"style":103},[2233],{"type":55,"value":335},{"type":50,"tag":84,"props":2235,"children":2236},{"style":97},[2237],{"type":55,"value":340},{"type":50,"tag":84,"props":2239,"children":2240},{"class":86,"line":302},[2241,2245,2249,2253,2257,2261,2265,2269,2273,2277],{"type":50,"tag":84,"props":2242,"children":2243},{"style":284},[2244],{"type":55,"value":930},{"type":50,"tag":84,"props":2246,"children":2247},{"style":97},[2248],{"type":55,"value":355},{"type":50,"tag":84,"props":2250,"children":2251},{"style":97},[2252],{"type":55,"value":583},{"type":50,"tag":84,"props":2254,"children":2255},{"style":566},[2256],{"type":55,"value":943},{"type":50,"tag":84,"props":2258,"children":2259},{"style":97},[2260],{"type":55,"value":466},{"type":50,"tag":84,"props":2262,"children":2263},{"style":263},[2264],{"type":55,"value":578},{"type":50,"tag":84,"props":2266,"children":2267},{"style":103},[2268],{"type":55,"value":956},{"type":50,"tag":84,"props":2270,"children":2271},{"style":97},[2272],{"type":55,"value":325},{"type":50,"tag":84,"props":2274,"children":2275},{"style":103},[2276],{"type":55,"value":965},{"type":50,"tag":84,"props":2278,"children":2279},{"style":97},[2280],{"type":55,"value":378},{"type":50,"tag":84,"props":2282,"children":2283},{"class":86,"line":343},[2284,2289,2293,2297,2302,2307,2311,2316,2320,2325,2329,2333,2338,2342,2346,2351,2355,2360,2364,2368],{"type":50,"tag":84,"props":2285,"children":2286},{"style":347},[2287],{"type":55,"value":2288},"    initialData",{"type":50,"tag":84,"props":2290,"children":2291},{"style":97},[2292],{"type":55,"value":355},{"type":50,"tag":84,"props":2294,"children":2295},{"style":103},[2296],{"type":55,"value":726},{"type":50,"tag":84,"props":2298,"children":2299},{"style":97},[2300],{"type":55,"value":2301},"{",{"type":50,"tag":84,"props":2303,"children":2304},{"style":347},[2305],{"type":55,"value":2306}," id",{"type":50,"tag":84,"props":2308,"children":2309},{"style":97},[2310],{"type":55,"value":355},{"type":50,"tag":84,"props":2312,"children":2313},{"style":1088},[2314],{"type":55,"value":2315}," 1",{"type":50,"tag":84,"props":2317,"children":2318},{"style":97},[2319],{"type":55,"value":524},{"type":50,"tag":84,"props":2321,"children":2322},{"style":347},[2323],{"type":55,"value":2324}," text",{"type":50,"tag":84,"props":2326,"children":2327},{"style":97},[2328],{"type":55,"value":355},{"type":50,"tag":84,"props":2330,"children":2331},{"style":97},[2332],{"type":55,"value":121},{"type":50,"tag":84,"props":2334,"children":2335},{"style":124},[2336],{"type":55,"value":2337},"Learn TanStack DB",{"type":50,"tag":84,"props":2339,"children":2340},{"style":97},[2341],{"type":55,"value":611},{"type":50,"tag":84,"props":2343,"children":2344},{"style":97},[2345],{"type":55,"value":524},{"type":50,"tag":84,"props":2347,"children":2348},{"style":347},[2349],{"type":55,"value":2350}," completed",{"type":50,"tag":84,"props":2352,"children":2353},{"style":97},[2354],{"type":55,"value":355},{"type":50,"tag":84,"props":2356,"children":2357},{"style":458},[2358],{"type":55,"value":2359}," false",{"type":50,"tag":84,"props":2361,"children":2362},{"style":97},[2363],{"type":55,"value":111},{"type":50,"tag":84,"props":2365,"children":2366},{"style":103},[2367],{"type":55,"value":744},{"type":50,"tag":84,"props":2369,"children":2370},{"style":97},[2371],{"type":55,"value":378},{"type":50,"tag":84,"props":2373,"children":2374},{"class":86,"line":381},[2375,2379,2383],{"type":50,"tag":84,"props":2376,"children":2377},{"style":97},[2378],{"type":55,"value":1394},{"type":50,"tag":84,"props":2380,"children":2381},{"style":103},[2382],{"type":55,"value":466},{"type":50,"tag":84,"props":2384,"children":2385},{"style":97},[2386],{"type":55,"value":378},{"type":50,"tag":84,"props":2388,"children":2389},{"class":86,"line":415},[2390],{"type":50,"tag":84,"props":2391,"children":2392},{"style":103},[2393],{"type":55,"value":657},{"type":50,"tag":2122,"props":2395,"children":2397},{"id":2396},"schema-with-type-transformations",[2398],{"type":55,"value":2399},"Schema with type transformations",{"type":50,"tag":72,"props":2401,"children":2403},{"className":74,"code":2402,"language":76,"meta":77,"style":77},"const schema = z.object({\n  id: z.number(),\n  title: z.string(),\n  due_date: z\n    .union([z.string(), z.date()])\n    .transform((val) => (typeof val === 'string' ? new Date(val) : val)),\n  priority: z.number().default(0),\n})\n",[2404],{"type":50,"tag":80,"props":2405,"children":2406},{"__ignoreMap":77},[2407,2443,2474,2506,2522,2569,2656,2708],{"type":50,"tag":84,"props":2408,"children":2409},{"class":86,"line":87},[2410,2414,2419,2423,2427,2431,2435,2439],{"type":50,"tag":84,"props":2411,"children":2412},{"style":263},[2413],{"type":55,"value":266},{"type":50,"tag":84,"props":2415,"children":2416},{"style":103},[2417],{"type":55,"value":2418}," schema ",{"type":50,"tag":84,"props":2420,"children":2421},{"style":97},[2422],{"type":55,"value":276},{"type":50,"tag":84,"props":2424,"children":2425},{"style":103},[2426],{"type":55,"value":225},{"type":50,"tag":84,"props":2428,"children":2429},{"style":97},[2430],{"type":55,"value":325},{"type":50,"tag":84,"props":2432,"children":2433},{"style":284},[2434],{"type":55,"value":330},{"type":50,"tag":84,"props":2436,"children":2437},{"style":103},[2438],{"type":55,"value":335},{"type":50,"tag":84,"props":2440,"children":2441},{"style":97},[2442],{"type":55,"value":340},{"type":50,"tag":84,"props":2444,"children":2445},{"class":86,"line":135},[2446,2450,2454,2458,2462,2466,2470],{"type":50,"tag":84,"props":2447,"children":2448},{"style":347},[2449],{"type":55,"value":350},{"type":50,"tag":84,"props":2451,"children":2452},{"style":97},[2453],{"type":55,"value":355},{"type":50,"tag":84,"props":2455,"children":2456},{"style":103},[2457],{"type":55,"value":225},{"type":50,"tag":84,"props":2459,"children":2460},{"style":97},[2461],{"type":55,"value":325},{"type":50,"tag":84,"props":2463,"children":2464},{"style":284},[2465],{"type":55,"value":368},{"type":50,"tag":84,"props":2467,"children":2468},{"style":103},[2469],{"type":55,"value":373},{"type":50,"tag":84,"props":2471,"children":2472},{"style":97},[2473],{"type":55,"value":378},{"type":50,"tag":84,"props":2475,"children":2476},{"class":86,"line":173},[2477,2482,2486,2490,2494,2498,2502],{"type":50,"tag":84,"props":2478,"children":2479},{"style":347},[2480],{"type":55,"value":2481},"  title",{"type":50,"tag":84,"props":2483,"children":2484},{"style":97},[2485],{"type":55,"value":355},{"type":50,"tag":84,"props":2487,"children":2488},{"style":103},[2489],{"type":55,"value":225},{"type":50,"tag":84,"props":2491,"children":2492},{"style":97},[2493],{"type":55,"value":325},{"type":50,"tag":84,"props":2495,"children":2496},{"style":284},[2497],{"type":55,"value":404},{"type":50,"tag":84,"props":2499,"children":2500},{"style":103},[2501],{"type":55,"value":373},{"type":50,"tag":84,"props":2503,"children":2504},{"style":97},[2505],{"type":55,"value":378},{"type":50,"tag":84,"props":2507,"children":2508},{"class":86,"line":211},[2509,2514,2518],{"type":50,"tag":84,"props":2510,"children":2511},{"style":347},[2512],{"type":55,"value":2513},"  due_date",{"type":50,"tag":84,"props":2515,"children":2516},{"style":97},[2517],{"type":55,"value":355},{"type":50,"tag":84,"props":2519,"children":2520},{"style":103},[2521],{"type":55,"value":488},{"type":50,"tag":84,"props":2523,"children":2524},{"class":86,"line":249},[2525,2529,2533,2537,2541,2545,2549,2553,2557,2561,2565],{"type":50,"tag":84,"props":2526,"children":2527},{"style":97},[2528],{"type":55,"value":497},{"type":50,"tag":84,"props":2530,"children":2531},{"style":284},[2532],{"type":55,"value":502},{"type":50,"tag":84,"props":2534,"children":2535},{"style":103},[2536],{"type":55,"value":507},{"type":50,"tag":84,"props":2538,"children":2539},{"style":97},[2540],{"type":55,"value":325},{"type":50,"tag":84,"props":2542,"children":2543},{"style":284},[2544],{"type":55,"value":404},{"type":50,"tag":84,"props":2546,"children":2547},{"style":103},[2548],{"type":55,"value":373},{"type":50,"tag":84,"props":2550,"children":2551},{"style":97},[2552],{"type":55,"value":524},{"type":50,"tag":84,"props":2554,"children":2555},{"style":103},[2556],{"type":55,"value":225},{"type":50,"tag":84,"props":2558,"children":2559},{"style":97},[2560],{"type":55,"value":325},{"type":50,"tag":84,"props":2562,"children":2563},{"style":284},[2564],{"type":55,"value":537},{"type":50,"tag":84,"props":2566,"children":2567},{"style":103},[2568],{"type":55,"value":542},{"type":50,"tag":84,"props":2570,"children":2571},{"class":86,"line":259},[2572,2576,2580,2584,2588,2592,2596,2600,2604,2608,2612,2616,2620,2624,2628,2632,2636,2640,2644,2648,2652],{"type":50,"tag":84,"props":2573,"children":2574},{"style":97},[2575],{"type":55,"value":497},{"type":50,"tag":84,"props":2577,"children":2578},{"style":284},[2579],{"type":55,"value":555},{"type":50,"tag":84,"props":2581,"children":2582},{"style":103},[2583],{"type":55,"value":335},{"type":50,"tag":84,"props":2585,"children":2586},{"style":97},[2587],{"type":55,"value":335},{"type":50,"tag":84,"props":2589,"children":2590},{"style":566},[2591],{"type":55,"value":569},{"type":50,"tag":84,"props":2593,"children":2594},{"style":97},[2595],{"type":55,"value":466},{"type":50,"tag":84,"props":2597,"children":2598},{"style":263},[2599],{"type":55,"value":578},{"type":50,"tag":84,"props":2601,"children":2602},{"style":103},[2603],{"type":55,"value":583},{"type":50,"tag":84,"props":2605,"children":2606},{"style":97},[2607],{"type":55,"value":588},{"type":50,"tag":84,"props":2609,"children":2610},{"style":103},[2611],{"type":55,"value":593},{"type":50,"tag":84,"props":2613,"children":2614},{"style":97},[2615],{"type":55,"value":598},{"type":50,"tag":84,"props":2617,"children":2618},{"style":97},[2619],{"type":55,"value":121},{"type":50,"tag":84,"props":2621,"children":2622},{"style":124},[2623],{"type":55,"value":404},{"type":50,"tag":84,"props":2625,"children":2626},{"style":97},[2627],{"type":55,"value":611},{"type":50,"tag":84,"props":2629,"children":2630},{"style":97},[2631],{"type":55,"value":616},{"type":50,"tag":84,"props":2633,"children":2634},{"style":97},[2635],{"type":55,"value":281},{"type":50,"tag":84,"props":2637,"children":2638},{"style":284},[2639],{"type":55,"value":625},{"type":50,"tag":84,"props":2641,"children":2642},{"style":103},[2643],{"type":55,"value":630},{"type":50,"tag":84,"props":2645,"children":2646},{"style":97},[2647],{"type":55,"value":355},{"type":50,"tag":84,"props":2649,"children":2650},{"style":103},[2651],{"type":55,"value":639},{"type":50,"tag":84,"props":2653,"children":2654},{"style":97},[2655],{"type":55,"value":378},{"type":50,"tag":84,"props":2657,"children":2658},{"class":86,"line":294},[2659,2664,2668,2672,2676,2680,2684,2688,2692,2696,2700,2704],{"type":50,"tag":84,"props":2660,"children":2661},{"style":347},[2662],{"type":55,"value":2663},"  priority",{"type":50,"tag":84,"props":2665,"children":2666},{"style":97},[2667],{"type":55,"value":355},{"type":50,"tag":84,"props":2669,"children":2670},{"style":103},[2671],{"type":55,"value":225},{"type":50,"tag":84,"props":2673,"children":2674},{"style":97},[2675],{"type":55,"value":325},{"type":50,"tag":84,"props":2677,"children":2678},{"style":284},[2679],{"type":55,"value":368},{"type":50,"tag":84,"props":2681,"children":2682},{"style":103},[2683],{"type":55,"value":373},{"type":50,"tag":84,"props":2685,"children":2686},{"style":97},[2687],{"type":55,"value":325},{"type":50,"tag":84,"props":2689,"children":2690},{"style":284},[2691],{"type":55,"value":451},{"type":50,"tag":84,"props":2693,"children":2694},{"style":103},[2695],{"type":55,"value":335},{"type":50,"tag":84,"props":2697,"children":2698},{"style":1088},[2699],{"type":55,"value":1091},{"type":50,"tag":84,"props":2701,"children":2702},{"style":103},[2703],{"type":55,"value":466},{"type":50,"tag":84,"props":2705,"children":2706},{"style":97},[2707],{"type":55,"value":378},{"type":50,"tag":84,"props":2709,"children":2710},{"class":86,"line":302},[2711,2715],{"type":50,"tag":84,"props":2712,"children":2713},{"style":97},[2714],{"type":55,"value":652},{"type":50,"tag":84,"props":2716,"children":2717},{"style":103},[2718],{"type":55,"value":657},{"type":50,"tag":51,"props":2720,"children":2721},{},[2722,2724,2730,2732,2738,2740,2746,2748,2754],{"type":55,"value":2723},"Use ",{"type":50,"tag":80,"props":2725,"children":2727},{"className":2726},[],[2728],{"type":55,"value":2729},"z.union([z.string(), z.date()])",{"type":55,"value":2731}," for transformed fields — this ensures ",{"type":50,"tag":80,"props":2733,"children":2735},{"className":2734},[],[2736],{"type":55,"value":2737},"TInput",{"type":55,"value":2739}," is a superset of ",{"type":50,"tag":80,"props":2741,"children":2743},{"className":2742},[],[2744],{"type":55,"value":2745},"TOutput",{"type":55,"value":2747}," so that ",{"type":50,"tag":80,"props":2749,"children":2751},{"className":2750},[],[2752],{"type":55,"value":2753},"update()",{"type":55,"value":2755}," works correctly with the draft proxy.",{"type":50,"tag":2122,"props":2757,"children":2759},{"id":2758},"electricsql-with-txid-tracking",[2760],{"type":55,"value":2761},"ElectricSQL with txid tracking",{"type":50,"tag":51,"props":2763,"children":2764},{},[2765,2767,2773],{"type":55,"value":2766},"Always use a schema with Electric — without one, the collection types as ",{"type":50,"tag":80,"props":2768,"children":2770},{"className":2769},[],[2771],{"type":55,"value":2772},"Record\u003Cstring, unknown>",{"type":55,"value":325},{"type":50,"tag":72,"props":2775,"children":2777},{"className":74,"code":2776,"language":76,"meta":77,"style":77},"import { electricCollectionOptions } from '@tanstack\u002Felectric-db-collection'\nimport { z } from 'zod'\n\nconst todoSchema = z.object({\n  id: z.string(),\n  text: z.string(),\n  completed: z.boolean(),\n  created_at: z.coerce.date(),\n})\n\nconst todoCollection = createCollection(\n  electricCollectionOptions({\n    schema: todoSchema,\n    shapeOptions: { url: '\u002Fapi\u002Felectric\u002Ftodos' },\n    getKey: (item) => item.id,\n    onInsert: async ({ transaction }) => {\n      const res = await api.todos.create(transaction.mutations[0].modified)\n      return { txid: res.txid }\n    },\n  }),\n)\n",[2778],{"type":50,"tag":80,"props":2779,"children":2780},{"__ignoreMap":77},[2781,2817,2852,2859,2894,2925,2956,2987,3027,3038,3045,3068,3084,3103,3146,3189,3224,3303,3341,3348,3363],{"type":50,"tag":84,"props":2782,"children":2783},{"class":86,"line":87},[2784,2788,2792,2797,2801,2805,2809,2813],{"type":50,"tag":84,"props":2785,"children":2786},{"style":91},[2787],{"type":55,"value":94},{"type":50,"tag":84,"props":2789,"children":2790},{"style":97},[2791],{"type":55,"value":100},{"type":50,"tag":84,"props":2793,"children":2794},{"style":103},[2795],{"type":55,"value":2796}," electricCollectionOptions",{"type":50,"tag":84,"props":2798,"children":2799},{"style":97},[2800],{"type":55,"value":111},{"type":50,"tag":84,"props":2802,"children":2803},{"style":91},[2804],{"type":55,"value":116},{"type":50,"tag":84,"props":2806,"children":2807},{"style":97},[2808],{"type":55,"value":121},{"type":50,"tag":84,"props":2810,"children":2811},{"style":124},[2812],{"type":55,"value":1500},{"type":50,"tag":84,"props":2814,"children":2815},{"style":97},[2816],{"type":55,"value":132},{"type":50,"tag":84,"props":2818,"children":2819},{"class":86,"line":135},[2820,2824,2828,2832,2836,2840,2844,2848],{"type":50,"tag":84,"props":2821,"children":2822},{"style":91},[2823],{"type":55,"value":94},{"type":50,"tag":84,"props":2825,"children":2826},{"style":97},[2827],{"type":55,"value":100},{"type":50,"tag":84,"props":2829,"children":2830},{"style":103},[2831],{"type":55,"value":225},{"type":50,"tag":84,"props":2833,"children":2834},{"style":97},[2835],{"type":55,"value":111},{"type":50,"tag":84,"props":2837,"children":2838},{"style":91},[2839],{"type":55,"value":116},{"type":50,"tag":84,"props":2841,"children":2842},{"style":97},[2843],{"type":55,"value":121},{"type":50,"tag":84,"props":2845,"children":2846},{"style":124},[2847],{"type":55,"value":242},{"type":50,"tag":84,"props":2849,"children":2850},{"style":97},[2851],{"type":55,"value":132},{"type":50,"tag":84,"props":2853,"children":2854},{"class":86,"line":173},[2855],{"type":50,"tag":84,"props":2856,"children":2857},{"emptyLinePlaceholder":253},[2858],{"type":55,"value":256},{"type":50,"tag":84,"props":2860,"children":2861},{"class":86,"line":211},[2862,2866,2870,2874,2878,2882,2886,2890],{"type":50,"tag":84,"props":2863,"children":2864},{"style":263},[2865],{"type":55,"value":266},{"type":50,"tag":84,"props":2867,"children":2868},{"style":103},[2869],{"type":55,"value":312},{"type":50,"tag":84,"props":2871,"children":2872},{"style":97},[2873],{"type":55,"value":276},{"type":50,"tag":84,"props":2875,"children":2876},{"style":103},[2877],{"type":55,"value":225},{"type":50,"tag":84,"props":2879,"children":2880},{"style":97},[2881],{"type":55,"value":325},{"type":50,"tag":84,"props":2883,"children":2884},{"style":284},[2885],{"type":55,"value":330},{"type":50,"tag":84,"props":2887,"children":2888},{"style":103},[2889],{"type":55,"value":335},{"type":50,"tag":84,"props":2891,"children":2892},{"style":97},[2893],{"type":55,"value":340},{"type":50,"tag":84,"props":2895,"children":2896},{"class":86,"line":249},[2897,2901,2905,2909,2913,2917,2921],{"type":50,"tag":84,"props":2898,"children":2899},{"style":347},[2900],{"type":55,"value":350},{"type":50,"tag":84,"props":2902,"children":2903},{"style":97},[2904],{"type":55,"value":355},{"type":50,"tag":84,"props":2906,"children":2907},{"style":103},[2908],{"type":55,"value":225},{"type":50,"tag":84,"props":2910,"children":2911},{"style":97},[2912],{"type":55,"value":325},{"type":50,"tag":84,"props":2914,"children":2915},{"style":284},[2916],{"type":55,"value":404},{"type":50,"tag":84,"props":2918,"children":2919},{"style":103},[2920],{"type":55,"value":373},{"type":50,"tag":84,"props":2922,"children":2923},{"style":97},[2924],{"type":55,"value":378},{"type":50,"tag":84,"props":2926,"children":2927},{"class":86,"line":259},[2928,2932,2936,2940,2944,2948,2952],{"type":50,"tag":84,"props":2929,"children":2930},{"style":347},[2931],{"type":55,"value":387},{"type":50,"tag":84,"props":2933,"children":2934},{"style":97},[2935],{"type":55,"value":355},{"type":50,"tag":84,"props":2937,"children":2938},{"style":103},[2939],{"type":55,"value":225},{"type":50,"tag":84,"props":2941,"children":2942},{"style":97},[2943],{"type":55,"value":325},{"type":50,"tag":84,"props":2945,"children":2946},{"style":284},[2947],{"type":55,"value":404},{"type":50,"tag":84,"props":2949,"children":2950},{"style":103},[2951],{"type":55,"value":373},{"type":50,"tag":84,"props":2953,"children":2954},{"style":97},[2955],{"type":55,"value":378},{"type":50,"tag":84,"props":2957,"children":2958},{"class":86,"line":294},[2959,2963,2967,2971,2975,2979,2983],{"type":50,"tag":84,"props":2960,"children":2961},{"style":347},[2962],{"type":55,"value":421},{"type":50,"tag":84,"props":2964,"children":2965},{"style":97},[2966],{"type":55,"value":355},{"type":50,"tag":84,"props":2968,"children":2969},{"style":103},[2970],{"type":55,"value":225},{"type":50,"tag":84,"props":2972,"children":2973},{"style":97},[2974],{"type":55,"value":325},{"type":50,"tag":84,"props":2976,"children":2977},{"style":284},[2978],{"type":55,"value":438},{"type":50,"tag":84,"props":2980,"children":2981},{"style":103},[2982],{"type":55,"value":373},{"type":50,"tag":84,"props":2984,"children":2985},{"style":97},[2986],{"type":55,"value":378},{"type":50,"tag":84,"props":2988,"children":2989},{"class":86,"line":302},[2990,2994,2998,3002,3006,3011,3015,3019,3023],{"type":50,"tag":84,"props":2991,"children":2992},{"style":347},[2993],{"type":55,"value":479},{"type":50,"tag":84,"props":2995,"children":2996},{"style":97},[2997],{"type":55,"value":355},{"type":50,"tag":84,"props":2999,"children":3000},{"style":103},[3001],{"type":55,"value":225},{"type":50,"tag":84,"props":3003,"children":3004},{"style":97},[3005],{"type":55,"value":325},{"type":50,"tag":84,"props":3007,"children":3008},{"style":103},[3009],{"type":55,"value":3010},"coerce",{"type":50,"tag":84,"props":3012,"children":3013},{"style":97},[3014],{"type":55,"value":325},{"type":50,"tag":84,"props":3016,"children":3017},{"style":284},[3018],{"type":55,"value":537},{"type":50,"tag":84,"props":3020,"children":3021},{"style":103},[3022],{"type":55,"value":373},{"type":50,"tag":84,"props":3024,"children":3025},{"style":97},[3026],{"type":55,"value":378},{"type":50,"tag":84,"props":3028,"children":3029},{"class":86,"line":343},[3030,3034],{"type":50,"tag":84,"props":3031,"children":3032},{"style":97},[3033],{"type":55,"value":652},{"type":50,"tag":84,"props":3035,"children":3036},{"style":103},[3037],{"type":55,"value":657},{"type":50,"tag":84,"props":3039,"children":3040},{"class":86,"line":381},[3041],{"type":50,"tag":84,"props":3042,"children":3043},{"emptyLinePlaceholder":253},[3044],{"type":55,"value":256},{"type":50,"tag":84,"props":3046,"children":3047},{"class":86,"line":415},[3048,3052,3056,3060,3064],{"type":50,"tag":84,"props":3049,"children":3050},{"style":263},[3051],{"type":55,"value":266},{"type":50,"tag":84,"props":3053,"children":3054},{"style":103},[3055],{"type":55,"value":678},{"type":50,"tag":84,"props":3057,"children":3058},{"style":97},[3059],{"type":55,"value":276},{"type":50,"tag":84,"props":3061,"children":3062},{"style":284},[3063],{"type":55,"value":106},{"type":50,"tag":84,"props":3065,"children":3066},{"style":103},[3067],{"type":55,"value":691},{"type":50,"tag":84,"props":3069,"children":3070},{"class":86,"line":473},[3071,3076,3080],{"type":50,"tag":84,"props":3072,"children":3073},{"style":284},[3074],{"type":55,"value":3075},"  electricCollectionOptions",{"type":50,"tag":84,"props":3077,"children":3078},{"style":103},[3079],{"type":55,"value":335},{"type":50,"tag":84,"props":3081,"children":3082},{"style":97},[3083],{"type":55,"value":340},{"type":50,"tag":84,"props":3085,"children":3086},{"class":86,"line":491},[3087,3091,3095,3099],{"type":50,"tag":84,"props":3088,"children":3089},{"style":347},[3090],{"type":55,"value":978},{"type":50,"tag":84,"props":3092,"children":3093},{"style":97},[3094],{"type":55,"value":355},{"type":50,"tag":84,"props":3096,"children":3097},{"style":103},[3098],{"type":55,"value":987},{"type":50,"tag":84,"props":3100,"children":3101},{"style":97},[3102],{"type":55,"value":378},{"type":50,"tag":84,"props":3104,"children":3105},{"class":86,"line":545},[3106,3111,3115,3119,3124,3128,3132,3137,3141],{"type":50,"tag":84,"props":3107,"children":3108},{"style":347},[3109],{"type":55,"value":3110},"    shapeOptions",{"type":50,"tag":84,"props":3112,"children":3113},{"style":97},[3114],{"type":55,"value":355},{"type":50,"tag":84,"props":3116,"children":3117},{"style":97},[3118],{"type":55,"value":100},{"type":50,"tag":84,"props":3120,"children":3121},{"style":347},[3122],{"type":55,"value":3123}," url",{"type":50,"tag":84,"props":3125,"children":3126},{"style":97},[3127],{"type":55,"value":355},{"type":50,"tag":84,"props":3129,"children":3130},{"style":97},[3131],{"type":55,"value":121},{"type":50,"tag":84,"props":3133,"children":3134},{"style":124},[3135],{"type":55,"value":3136},"\u002Fapi\u002Felectric\u002Ftodos",{"type":50,"tag":84,"props":3138,"children":3139},{"style":97},[3140],{"type":55,"value":611},{"type":50,"tag":84,"props":3142,"children":3143},{"style":97},[3144],{"type":55,"value":3145}," },\n",{"type":50,"tag":84,"props":3147,"children":3148},{"class":86,"line":646},[3149,3153,3157,3161,3165,3169,3173,3177,3181,3185],{"type":50,"tag":84,"props":3150,"children":3151},{"style":284},[3152],{"type":55,"value":930},{"type":50,"tag":84,"props":3154,"children":3155},{"style":97},[3156],{"type":55,"value":355},{"type":50,"tag":84,"props":3158,"children":3159},{"style":97},[3160],{"type":55,"value":583},{"type":50,"tag":84,"props":3162,"children":3163},{"style":566},[3164],{"type":55,"value":943},{"type":50,"tag":84,"props":3166,"children":3167},{"style":97},[3168],{"type":55,"value":466},{"type":50,"tag":84,"props":3170,"children":3171},{"style":263},[3172],{"type":55,"value":578},{"type":50,"tag":84,"props":3174,"children":3175},{"style":103},[3176],{"type":55,"value":956},{"type":50,"tag":84,"props":3178,"children":3179},{"style":97},[3180],{"type":55,"value":325},{"type":50,"tag":84,"props":3182,"children":3183},{"style":103},[3184],{"type":55,"value":965},{"type":50,"tag":84,"props":3186,"children":3187},{"style":97},[3188],{"type":55,"value":378},{"type":50,"tag":84,"props":3190,"children":3191},{"class":86,"line":660},[3192,3196,3200,3204,3208,3212,3216,3220],{"type":50,"tag":84,"props":3193,"children":3194},{"style":284},[3195],{"type":55,"value":1000},{"type":50,"tag":84,"props":3197,"children":3198},{"style":97},[3199],{"type":55,"value":355},{"type":50,"tag":84,"props":3201,"children":3202},{"style":263},[3203],{"type":55,"value":766},{"type":50,"tag":84,"props":3205,"children":3206},{"style":97},[3207],{"type":55,"value":1013},{"type":50,"tag":84,"props":3209,"children":3210},{"style":566},[3211],{"type":55,"value":1018},{"type":50,"tag":84,"props":3213,"children":3214},{"style":97},[3215],{"type":55,"value":1023},{"type":50,"tag":84,"props":3217,"children":3218},{"style":263},[3219],{"type":55,"value":578},{"type":50,"tag":84,"props":3221,"children":3222},{"style":97},[3223],{"type":55,"value":788},{"type":50,"tag":84,"props":3225,"children":3226},{"class":86,"line":668},[3227,3231,3235,3239,3243,3247,3251,3255,3259,3263,3267,3271,3275,3279,3283,3287,3291,3295,3299],{"type":50,"tag":84,"props":3228,"children":3229},{"style":263},[3230],{"type":55,"value":797},{"type":50,"tag":84,"props":3232,"children":3233},{"style":103},[3234],{"type":55,"value":802},{"type":50,"tag":84,"props":3236,"children":3237},{"style":97},[3238],{"type":55,"value":807},{"type":50,"tag":84,"props":3240,"children":3241},{"style":91},[3242],{"type":55,"value":812},{"type":50,"tag":84,"props":3244,"children":3245},{"style":103},[3246],{"type":55,"value":1045},{"type":50,"tag":84,"props":3248,"children":3249},{"style":97},[3250],{"type":55,"value":325},{"type":50,"tag":84,"props":3252,"children":3253},{"style":103},[3254],{"type":55,"value":735},{"type":50,"tag":84,"props":3256,"children":3257},{"style":97},[3258],{"type":55,"value":325},{"type":50,"tag":84,"props":3260,"children":3261},{"style":284},[3262],{"type":55,"value":1062},{"type":50,"tag":84,"props":3264,"children":3265},{"style":347},[3266],{"type":55,"value":335},{"type":50,"tag":84,"props":3268,"children":3269},{"style":103},[3270],{"type":55,"value":1071},{"type":50,"tag":84,"props":3272,"children":3273},{"style":97},[3274],{"type":55,"value":325},{"type":50,"tag":84,"props":3276,"children":3277},{"style":103},[3278],{"type":55,"value":1080},{"type":50,"tag":84,"props":3280,"children":3281},{"style":347},[3282],{"type":55,"value":1085},{"type":50,"tag":84,"props":3284,"children":3285},{"style":1088},[3286],{"type":55,"value":1091},{"type":50,"tag":84,"props":3288,"children":3289},{"style":347},[3290],{"type":55,"value":744},{"type":50,"tag":84,"props":3292,"children":3293},{"style":97},[3294],{"type":55,"value":325},{"type":50,"tag":84,"props":3296,"children":3297},{"style":103},[3298],{"type":55,"value":1104},{"type":50,"tag":84,"props":3300,"children":3301},{"style":347},[3302],{"type":55,"value":657},{"type":50,"tag":84,"props":3304,"children":3305},{"class":86,"line":694},[3306,3310,3314,3319,3323,3327,3331,3336],{"type":50,"tag":84,"props":3307,"children":3308},{"style":91},[3309],{"type":55,"value":882},{"type":50,"tag":84,"props":3311,"children":3312},{"style":97},[3313],{"type":55,"value":100},{"type":50,"tag":84,"props":3315,"children":3316},{"style":347},[3317],{"type":55,"value":3318}," txid",{"type":50,"tag":84,"props":3320,"children":3321},{"style":97},[3322],{"type":55,"value":355},{"type":50,"tag":84,"props":3324,"children":3325},{"style":103},[3326],{"type":55,"value":802},{"type":50,"tag":84,"props":3328,"children":3329},{"style":97},[3330],{"type":55,"value":325},{"type":50,"tag":84,"props":3332,"children":3333},{"style":103},[3334],{"type":55,"value":3335},"txid",{"type":50,"tag":84,"props":3337,"children":3338},{"style":97},[3339],{"type":55,"value":3340}," }\n",{"type":50,"tag":84,"props":3342,"children":3343},{"class":86,"line":711},[3344],{"type":50,"tag":84,"props":3345,"children":3346},{"style":97},[3347],{"type":55,"value":908},{"type":50,"tag":84,"props":3349,"children":3350},{"class":86,"line":751},[3351,3355,3359],{"type":50,"tag":84,"props":3352,"children":3353},{"style":97},[3354],{"type":55,"value":1394},{"type":50,"tag":84,"props":3356,"children":3357},{"style":103},[3358],{"type":55,"value":466},{"type":50,"tag":84,"props":3360,"children":3361},{"style":97},[3362],{"type":55,"value":378},{"type":50,"tag":84,"props":3364,"children":3365},{"class":86,"line":791},[3366],{"type":50,"tag":84,"props":3367,"children":3368},{"style":103},[3369],{"type":55,"value":657},{"type":50,"tag":51,"props":3371,"children":3372},{},[3373,3375,3380,3382,3388],{"type":55,"value":3374},"The returned ",{"type":50,"tag":80,"props":3376,"children":3378},{"className":3377},[],[3379],{"type":55,"value":3335},{"type":55,"value":3381}," tells the collection to hold optimistic state until Electric streams back that transaction. See the ",{"type":50,"tag":1869,"props":3383,"children":3385},{"href":3384},"references\u002Felectric-adapter.md",[3386],{"type":55,"value":3387},"Electric adapter reference",{"type":55,"value":3389}," for the full dual-path pattern (schema + parser).",{"type":50,"tag":65,"props":3391,"children":3393},{"id":3392},"common-mistakes",[3394],{"type":55,"value":3395},"Common Mistakes",{"type":50,"tag":2122,"props":3397,"children":3399},{"id":3398},"critical-queryfn-returning-empty-array-deletes-all-data",[3400],{"type":55,"value":3401},"CRITICAL queryFn returning empty array deletes all data",{"type":50,"tag":51,"props":3403,"children":3404},{},[3405],{"type":55,"value":3406},"Wrong:",{"type":50,"tag":72,"props":3408,"children":3410},{"className":74,"code":3409,"language":76,"meta":77,"style":77},"queryCollectionOptions({\n  queryFn: async () => {\n    const res = await fetch('\u002Fapi\u002Ftodos?status=active')\n    return res.json() \u002F\u002F returns [] when no active todos — deletes everything\n  },\n})\n",[3411],{"type":50,"tag":80,"props":3412,"children":3413},{"__ignoreMap":77},[3414,3429,3458,3503,3533,3541],{"type":50,"tag":84,"props":3415,"children":3416},{"class":86,"line":87},[3417,3421,3425],{"type":50,"tag":84,"props":3418,"children":3419},{"style":284},[3420],{"type":55,"value":1466},{"type":50,"tag":84,"props":3422,"children":3423},{"style":103},[3424],{"type":55,"value":335},{"type":50,"tag":84,"props":3426,"children":3427},{"style":97},[3428],{"type":55,"value":340},{"type":50,"tag":84,"props":3430,"children":3431},{"class":86,"line":135},[3432,3437,3441,3445,3450,3454],{"type":50,"tag":84,"props":3433,"children":3434},{"style":284},[3435],{"type":55,"value":3436},"  queryFn",{"type":50,"tag":84,"props":3438,"children":3439},{"style":97},[3440],{"type":55,"value":355},{"type":50,"tag":84,"props":3442,"children":3443},{"style":263},[3444],{"type":55,"value":766},{"type":50,"tag":84,"props":3446,"children":3447},{"style":97},[3448],{"type":55,"value":3449}," ()",{"type":50,"tag":84,"props":3451,"children":3452},{"style":263},[3453],{"type":55,"value":578},{"type":50,"tag":84,"props":3455,"children":3456},{"style":97},[3457],{"type":55,"value":788},{"type":50,"tag":84,"props":3459,"children":3460},{"class":86,"line":173},[3461,3466,3470,3474,3478,3482,3486,3490,3495,3499],{"type":50,"tag":84,"props":3462,"children":3463},{"style":263},[3464],{"type":55,"value":3465},"    const",{"type":50,"tag":84,"props":3467,"children":3468},{"style":103},[3469],{"type":55,"value":802},{"type":50,"tag":84,"props":3471,"children":3472},{"style":97},[3473],{"type":55,"value":807},{"type":50,"tag":84,"props":3475,"children":3476},{"style":91},[3477],{"type":55,"value":812},{"type":50,"tag":84,"props":3479,"children":3480},{"style":284},[3481],{"type":55,"value":817},{"type":50,"tag":84,"props":3483,"children":3484},{"style":347},[3485],{"type":55,"value":335},{"type":50,"tag":84,"props":3487,"children":3488},{"style":97},[3489],{"type":55,"value":611},{"type":50,"tag":84,"props":3491,"children":3492},{"style":124},[3493],{"type":55,"value":3494},"\u002Fapi\u002Ftodos?status=active",{"type":50,"tag":84,"props":3496,"children":3497},{"style":97},[3498],{"type":55,"value":611},{"type":50,"tag":84,"props":3500,"children":3501},{"style":347},[3502],{"type":55,"value":657},{"type":50,"tag":84,"props":3504,"children":3505},{"class":86,"line":211},[3506,3511,3515,3519,3523,3528],{"type":50,"tag":84,"props":3507,"children":3508},{"style":91},[3509],{"type":55,"value":3510},"    return",{"type":50,"tag":84,"props":3512,"children":3513},{"style":103},[3514],{"type":55,"value":802},{"type":50,"tag":84,"props":3516,"children":3517},{"style":97},[3518],{"type":55,"value":325},{"type":50,"tag":84,"props":3520,"children":3521},{"style":284},[3522],{"type":55,"value":895},{"type":50,"tag":84,"props":3524,"children":3525},{"style":347},[3526],{"type":55,"value":3527},"() ",{"type":50,"tag":84,"props":3529,"children":3530},{"style":1701},[3531],{"type":55,"value":3532},"\u002F\u002F returns [] when no active todos — deletes everything\n",{"type":50,"tag":84,"props":3534,"children":3535},{"class":86,"line":249},[3536],{"type":50,"tag":84,"props":3537,"children":3538},{"style":97},[3539],{"type":55,"value":3540},"  },\n",{"type":50,"tag":84,"props":3542,"children":3543},{"class":86,"line":259},[3544,3548],{"type":50,"tag":84,"props":3545,"children":3546},{"style":97},[3547],{"type":55,"value":652},{"type":50,"tag":84,"props":3549,"children":3550},{"style":103},[3551],{"type":55,"value":657},{"type":50,"tag":51,"props":3553,"children":3554},{},[3555],{"type":55,"value":3556},"Correct:",{"type":50,"tag":72,"props":3558,"children":3560},{"className":74,"code":3559,"language":76,"meta":77,"style":77},"queryCollectionOptions({\n  queryFn: async () => {\n    const res = await fetch('\u002Fapi\u002Ftodos') \u002F\u002F fetch complete state\n    return res.json()\n  },\n  \u002F\u002F Use on-demand mode + live query where() for filtering\n  syncMode: 'on-demand',\n})\n",[3561],{"type":50,"tag":80,"props":3562,"children":3563},{"__ignoreMap":77},[3564,3579,3606,3655,3678,3685,3693,3720],{"type":50,"tag":84,"props":3565,"children":3566},{"class":86,"line":87},[3567,3571,3575],{"type":50,"tag":84,"props":3568,"children":3569},{"style":284},[3570],{"type":55,"value":1466},{"type":50,"tag":84,"props":3572,"children":3573},{"style":103},[3574],{"type":55,"value":335},{"type":50,"tag":84,"props":3576,"children":3577},{"style":97},[3578],{"type":55,"value":340},{"type":50,"tag":84,"props":3580,"children":3581},{"class":86,"line":135},[3582,3586,3590,3594,3598,3602],{"type":50,"tag":84,"props":3583,"children":3584},{"style":284},[3585],{"type":55,"value":3436},{"type":50,"tag":84,"props":3587,"children":3588},{"style":97},[3589],{"type":55,"value":355},{"type":50,"tag":84,"props":3591,"children":3592},{"style":263},[3593],{"type":55,"value":766},{"type":50,"tag":84,"props":3595,"children":3596},{"style":97},[3597],{"type":55,"value":3449},{"type":50,"tag":84,"props":3599,"children":3600},{"style":263},[3601],{"type":55,"value":578},{"type":50,"tag":84,"props":3603,"children":3604},{"style":97},[3605],{"type":55,"value":788},{"type":50,"tag":84,"props":3607,"children":3608},{"class":86,"line":173},[3609,3613,3617,3621,3625,3629,3633,3637,3641,3645,3650],{"type":50,"tag":84,"props":3610,"children":3611},{"style":263},[3612],{"type":55,"value":3465},{"type":50,"tag":84,"props":3614,"children":3615},{"style":103},[3616],{"type":55,"value":802},{"type":50,"tag":84,"props":3618,"children":3619},{"style":97},[3620],{"type":55,"value":807},{"type":50,"tag":84,"props":3622,"children":3623},{"style":91},[3624],{"type":55,"value":812},{"type":50,"tag":84,"props":3626,"children":3627},{"style":284},[3628],{"type":55,"value":817},{"type":50,"tag":84,"props":3630,"children":3631},{"style":347},[3632],{"type":55,"value":335},{"type":50,"tag":84,"props":3634,"children":3635},{"style":97},[3636],{"type":55,"value":611},{"type":50,"tag":84,"props":3638,"children":3639},{"style":124},[3640],{"type":55,"value":830},{"type":50,"tag":84,"props":3642,"children":3643},{"style":97},[3644],{"type":55,"value":611},{"type":50,"tag":84,"props":3646,"children":3647},{"style":347},[3648],{"type":55,"value":3649},") ",{"type":50,"tag":84,"props":3651,"children":3652},{"style":1701},[3653],{"type":55,"value":3654},"\u002F\u002F fetch complete state\n",{"type":50,"tag":84,"props":3656,"children":3657},{"class":86,"line":211},[3658,3662,3666,3670,3674],{"type":50,"tag":84,"props":3659,"children":3660},{"style":91},[3661],{"type":55,"value":3510},{"type":50,"tag":84,"props":3663,"children":3664},{"style":103},[3665],{"type":55,"value":802},{"type":50,"tag":84,"props":3667,"children":3668},{"style":97},[3669],{"type":55,"value":325},{"type":50,"tag":84,"props":3671,"children":3672},{"style":284},[3673],{"type":55,"value":895},{"type":50,"tag":84,"props":3675,"children":3676},{"style":347},[3677],{"type":55,"value":291},{"type":50,"tag":84,"props":3679,"children":3680},{"class":86,"line":249},[3681],{"type":50,"tag":84,"props":3682,"children":3683},{"style":97},[3684],{"type":55,"value":3540},{"type":50,"tag":84,"props":3686,"children":3687},{"class":86,"line":259},[3688],{"type":50,"tag":84,"props":3689,"children":3690},{"style":1701},[3691],{"type":55,"value":3692},"  \u002F\u002F Use on-demand mode + live query where() for filtering\n",{"type":50,"tag":84,"props":3694,"children":3695},{"class":86,"line":294},[3696,3700,3704,3708,3712,3716],{"type":50,"tag":84,"props":3697,"children":3698},{"style":347},[3699],{"type":55,"value":1677},{"type":50,"tag":84,"props":3701,"children":3702},{"style":97},[3703],{"type":55,"value":355},{"type":50,"tag":84,"props":3705,"children":3706},{"style":97},[3707],{"type":55,"value":121},{"type":50,"tag":84,"props":3709,"children":3710},{"style":124},[3711],{"type":55,"value":1801},{"type":50,"tag":84,"props":3713,"children":3714},{"style":97},[3715],{"type":55,"value":611},{"type":50,"tag":84,"props":3717,"children":3718},{"style":97},[3719],{"type":55,"value":378},{"type":50,"tag":84,"props":3721,"children":3722},{"class":86,"line":302},[3723,3727],{"type":50,"tag":84,"props":3724,"children":3725},{"style":97},[3726],{"type":55,"value":652},{"type":50,"tag":84,"props":3728,"children":3729},{"style":103},[3730],{"type":55,"value":657},{"type":50,"tag":51,"props":3732,"children":3733},{},[3734,3740,3742,3748],{"type":50,"tag":80,"props":3735,"children":3737},{"className":3736},[],[3738],{"type":55,"value":3739},"queryFn",{"type":55,"value":3741}," result is treated as complete server state. Returning ",{"type":50,"tag":80,"props":3743,"children":3745},{"className":3744},[],[3746],{"type":55,"value":3747},"[]",{"type":55,"value":3749}," means \"server has no items\", deleting all existing collection data.",{"type":50,"tag":51,"props":3751,"children":3752},{},[3753],{"type":55,"value":3754},"Source: docs\u002Fcollections\u002Fquery-collection.md",{"type":50,"tag":2122,"props":3756,"children":3758},{"id":3757},"critical-not-using-the-correct-adapter-for-your-backend",[3759],{"type":55,"value":3760},"CRITICAL Not using the correct adapter for your backend",{"type":50,"tag":51,"props":3762,"children":3763},{},[3764],{"type":55,"value":3406},{"type":50,"tag":72,"props":3766,"children":3768},{"className":74,"code":3767,"language":76,"meta":77,"style":77},"const todoCollection = createCollection(\n  localOnlyCollectionOptions({\n    getKey: (item) => item.id,\n  }),\n)\n\u002F\u002F Manually fetching and inserting...\n",[3769],{"type":50,"tag":80,"props":3770,"children":3771},{"__ignoreMap":77},[3772,3795,3810,3853,3868,3875],{"type":50,"tag":84,"props":3773,"children":3774},{"class":86,"line":87},[3775,3779,3783,3787,3791],{"type":50,"tag":84,"props":3776,"children":3777},{"style":263},[3778],{"type":55,"value":266},{"type":50,"tag":84,"props":3780,"children":3781},{"style":103},[3782],{"type":55,"value":678},{"type":50,"tag":84,"props":3784,"children":3785},{"style":97},[3786],{"type":55,"value":276},{"type":50,"tag":84,"props":3788,"children":3789},{"style":284},[3790],{"type":55,"value":106},{"type":50,"tag":84,"props":3792,"children":3793},{"style":103},[3794],{"type":55,"value":691},{"type":50,"tag":84,"props":3796,"children":3797},{"class":86,"line":135},[3798,3802,3806],{"type":50,"tag":84,"props":3799,"children":3800},{"style":284},[3801],{"type":55,"value":2165},{"type":50,"tag":84,"props":3803,"children":3804},{"style":103},[3805],{"type":55,"value":335},{"type":50,"tag":84,"props":3807,"children":3808},{"style":97},[3809],{"type":55,"value":340},{"type":50,"tag":84,"props":3811,"children":3812},{"class":86,"line":173},[3813,3817,3821,3825,3829,3833,3837,3841,3845,3849],{"type":50,"tag":84,"props":3814,"children":3815},{"style":284},[3816],{"type":55,"value":930},{"type":50,"tag":84,"props":3818,"children":3819},{"style":97},[3820],{"type":55,"value":355},{"type":50,"tag":84,"props":3822,"children":3823},{"style":97},[3824],{"type":55,"value":583},{"type":50,"tag":84,"props":3826,"children":3827},{"style":566},[3828],{"type":55,"value":943},{"type":50,"tag":84,"props":3830,"children":3831},{"style":97},[3832],{"type":55,"value":466},{"type":50,"tag":84,"props":3834,"children":3835},{"style":263},[3836],{"type":55,"value":578},{"type":50,"tag":84,"props":3838,"children":3839},{"style":103},[3840],{"type":55,"value":956},{"type":50,"tag":84,"props":3842,"children":3843},{"style":97},[3844],{"type":55,"value":325},{"type":50,"tag":84,"props":3846,"children":3847},{"style":103},[3848],{"type":55,"value":965},{"type":50,"tag":84,"props":3850,"children":3851},{"style":97},[3852],{"type":55,"value":378},{"type":50,"tag":84,"props":3854,"children":3855},{"class":86,"line":211},[3856,3860,3864],{"type":50,"tag":84,"props":3857,"children":3858},{"style":97},[3859],{"type":55,"value":1394},{"type":50,"tag":84,"props":3861,"children":3862},{"style":103},[3863],{"type":55,"value":466},{"type":50,"tag":84,"props":3865,"children":3866},{"style":97},[3867],{"type":55,"value":378},{"type":50,"tag":84,"props":3869,"children":3870},{"class":86,"line":249},[3871],{"type":50,"tag":84,"props":3872,"children":3873},{"style":103},[3874],{"type":55,"value":657},{"type":50,"tag":84,"props":3876,"children":3877},{"class":86,"line":259},[3878],{"type":50,"tag":84,"props":3879,"children":3880},{"style":1701},[3881],{"type":55,"value":3882},"\u002F\u002F Manually fetching and inserting...\n",{"type":50,"tag":51,"props":3884,"children":3885},{},[3886],{"type":55,"value":3556},{"type":50,"tag":72,"props":3888,"children":3890},{"className":74,"code":3889,"language":76,"meta":77,"style":77},"const todoCollection = createCollection(\n  queryCollectionOptions({\n    queryKey: ['todos'],\n    queryFn: async () => fetch('\u002Fapi\u002Ftodos').then((r) => r.json()),\n    queryClient,\n    getKey: (item) => item.id,\n  }),\n)\n",[3891],{"type":50,"tag":80,"props":3892,"children":3893},{"__ignoreMap":77},[3894,3917,3932,3967,4066,4077,4120,4135],{"type":50,"tag":84,"props":3895,"children":3896},{"class":86,"line":87},[3897,3901,3905,3909,3913],{"type":50,"tag":84,"props":3898,"children":3899},{"style":263},[3900],{"type":55,"value":266},{"type":50,"tag":84,"props":3902,"children":3903},{"style":103},[3904],{"type":55,"value":678},{"type":50,"tag":84,"props":3906,"children":3907},{"style":97},[3908],{"type":55,"value":276},{"type":50,"tag":84,"props":3910,"children":3911},{"style":284},[3912],{"type":55,"value":106},{"type":50,"tag":84,"props":3914,"children":3915},{"style":103},[3916],{"type":55,"value":691},{"type":50,"tag":84,"props":3918,"children":3919},{"class":86,"line":135},[3920,3924,3928],{"type":50,"tag":84,"props":3921,"children":3922},{"style":284},[3923],{"type":55,"value":700},{"type":50,"tag":84,"props":3925,"children":3926},{"style":103},[3927],{"type":55,"value":335},{"type":50,"tag":84,"props":3929,"children":3930},{"style":97},[3931],{"type":55,"value":340},{"type":50,"tag":84,"props":3933,"children":3934},{"class":86,"line":173},[3935,3939,3943,3947,3951,3955,3959,3963],{"type":50,"tag":84,"props":3936,"children":3937},{"style":347},[3938],{"type":55,"value":717},{"type":50,"tag":84,"props":3940,"children":3941},{"style":97},[3942],{"type":55,"value":355},{"type":50,"tag":84,"props":3944,"children":3945},{"style":103},[3946],{"type":55,"value":726},{"type":50,"tag":84,"props":3948,"children":3949},{"style":97},[3950],{"type":55,"value":611},{"type":50,"tag":84,"props":3952,"children":3953},{"style":124},[3954],{"type":55,"value":735},{"type":50,"tag":84,"props":3956,"children":3957},{"style":97},[3958],{"type":55,"value":611},{"type":50,"tag":84,"props":3960,"children":3961},{"style":103},[3962],{"type":55,"value":744},{"type":50,"tag":84,"props":3964,"children":3965},{"style":97},[3966],{"type":55,"value":378},{"type":50,"tag":84,"props":3968,"children":3969},{"class":86,"line":211},[3970,3974,3978,3982,3986,3990,3994,3998,4002,4006,4010,4014,4018,4023,4027,4031,4036,4040,4044,4049,4053,4057,4062],{"type":50,"tag":84,"props":3971,"children":3972},{"style":284},[3973],{"type":55,"value":757},{"type":50,"tag":84,"props":3975,"children":3976},{"style":97},[3977],{"type":55,"value":355},{"type":50,"tag":84,"props":3979,"children":3980},{"style":263},[3981],{"type":55,"value":766},{"type":50,"tag":84,"props":3983,"children":3984},{"style":97},[3985],{"type":55,"value":3449},{"type":50,"tag":84,"props":3987,"children":3988},{"style":263},[3989],{"type":55,"value":578},{"type":50,"tag":84,"props":3991,"children":3992},{"style":284},[3993],{"type":55,"value":817},{"type":50,"tag":84,"props":3995,"children":3996},{"style":103},[3997],{"type":55,"value":335},{"type":50,"tag":84,"props":3999,"children":4000},{"style":97},[4001],{"type":55,"value":611},{"type":50,"tag":84,"props":4003,"children":4004},{"style":124},[4005],{"type":55,"value":830},{"type":50,"tag":84,"props":4007,"children":4008},{"style":97},[4009],{"type":55,"value":611},{"type":50,"tag":84,"props":4011,"children":4012},{"style":103},[4013],{"type":55,"value":466},{"type":50,"tag":84,"props":4015,"children":4016},{"style":97},[4017],{"type":55,"value":325},{"type":50,"tag":84,"props":4019,"children":4020},{"style":284},[4021],{"type":55,"value":4022},"then",{"type":50,"tag":84,"props":4024,"children":4025},{"style":103},[4026],{"type":55,"value":335},{"type":50,"tag":84,"props":4028,"children":4029},{"style":97},[4030],{"type":55,"value":335},{"type":50,"tag":84,"props":4032,"children":4033},{"style":566},[4034],{"type":55,"value":4035},"r",{"type":50,"tag":84,"props":4037,"children":4038},{"style":97},[4039],{"type":55,"value":466},{"type":50,"tag":84,"props":4041,"children":4042},{"style":263},[4043],{"type":55,"value":578},{"type":50,"tag":84,"props":4045,"children":4046},{"style":103},[4047],{"type":55,"value":4048}," r",{"type":50,"tag":84,"props":4050,"children":4051},{"style":97},[4052],{"type":55,"value":325},{"type":50,"tag":84,"props":4054,"children":4055},{"style":284},[4056],{"type":55,"value":895},{"type":50,"tag":84,"props":4058,"children":4059},{"style":103},[4060],{"type":55,"value":4061},"())",{"type":50,"tag":84,"props":4063,"children":4064},{"style":97},[4065],{"type":55,"value":378},{"type":50,"tag":84,"props":4067,"children":4068},{"class":86,"line":249},[4069,4073],{"type":50,"tag":84,"props":4070,"children":4071},{"style":103},[4072],{"type":55,"value":917},{"type":50,"tag":84,"props":4074,"children":4075},{"style":97},[4076],{"type":55,"value":378},{"type":50,"tag":84,"props":4078,"children":4079},{"class":86,"line":259},[4080,4084,4088,4092,4096,4100,4104,4108,4112,4116],{"type":50,"tag":84,"props":4081,"children":4082},{"style":284},[4083],{"type":55,"value":930},{"type":50,"tag":84,"props":4085,"children":4086},{"style":97},[4087],{"type":55,"value":355},{"type":50,"tag":84,"props":4089,"children":4090},{"style":97},[4091],{"type":55,"value":583},{"type":50,"tag":84,"props":4093,"children":4094},{"style":566},[4095],{"type":55,"value":943},{"type":50,"tag":84,"props":4097,"children":4098},{"style":97},[4099],{"type":55,"value":466},{"type":50,"tag":84,"props":4101,"children":4102},{"style":263},[4103],{"type":55,"value":578},{"type":50,"tag":84,"props":4105,"children":4106},{"style":103},[4107],{"type":55,"value":956},{"type":50,"tag":84,"props":4109,"children":4110},{"style":97},[4111],{"type":55,"value":325},{"type":50,"tag":84,"props":4113,"children":4114},{"style":103},[4115],{"type":55,"value":965},{"type":50,"tag":84,"props":4117,"children":4118},{"style":97},[4119],{"type":55,"value":378},{"type":50,"tag":84,"props":4121,"children":4122},{"class":86,"line":294},[4123,4127,4131],{"type":50,"tag":84,"props":4124,"children":4125},{"style":97},[4126],{"type":55,"value":1394},{"type":50,"tag":84,"props":4128,"children":4129},{"style":103},[4130],{"type":55,"value":466},{"type":50,"tag":84,"props":4132,"children":4133},{"style":97},[4134],{"type":55,"value":378},{"type":50,"tag":84,"props":4136,"children":4137},{"class":86,"line":302},[4138],{"type":50,"tag":84,"props":4139,"children":4140},{"style":103},[4141],{"type":55,"value":657},{"type":50,"tag":51,"props":4143,"children":4144},{},[4145,4147,4152,4154,4159],{"type":55,"value":4146},"Each backend has a dedicated adapter that handles sync, mutation handlers, and utilities. Using ",{"type":50,"tag":80,"props":4148,"children":4150},{"className":4149},[],[4151],{"type":55,"value":1595},{"type":55,"value":4153}," or bare ",{"type":50,"tag":80,"props":4155,"children":4157},{"className":4156},[],[4158],{"type":55,"value":1975},{"type":55,"value":4160}," for a real backend bypasses all of this.",{"type":50,"tag":51,"props":4162,"children":4163},{},[4164],{"type":55,"value":4165},"Source: docs\u002Foverview.md",{"type":50,"tag":2122,"props":4167,"children":4169},{"id":4168},"critical-electric-txid-queried-outside-mutation-transaction",[4170],{"type":55,"value":4171},"CRITICAL Electric txid queried outside mutation transaction",{"type":50,"tag":51,"props":4173,"children":4174},{},[4175],{"type":55,"value":3406},{"type":50,"tag":72,"props":4177,"children":4179},{"className":74,"code":4178,"language":76,"meta":77,"style":77},"\u002F\u002F Backend handler\napp.post('\u002Fapi\u002Ftodos', async (req, res) => {\n  const txid = await generateTxId(sql) \u002F\u002F WRONG: separate transaction\n  await sql`INSERT INTO todos ${sql(req.body)}`\n  res.json({ txid })\n})\n",[4180],{"type":50,"tag":80,"props":4181,"children":4182},{"__ignoreMap":77},[4183,4191,4261,4304,4355,4391],{"type":50,"tag":84,"props":4184,"children":4185},{"class":86,"line":87},[4186],{"type":50,"tag":84,"props":4187,"children":4188},{"style":1701},[4189],{"type":55,"value":4190},"\u002F\u002F Backend handler\n",{"type":50,"tag":84,"props":4192,"children":4193},{"class":86,"line":135},[4194,4199,4203,4208,4212,4216,4220,4224,4228,4232,4236,4241,4245,4249,4253,4257],{"type":50,"tag":84,"props":4195,"children":4196},{"style":103},[4197],{"type":55,"value":4198},"app",{"type":50,"tag":84,"props":4200,"children":4201},{"style":97},[4202],{"type":55,"value":325},{"type":50,"tag":84,"props":4204,"children":4205},{"style":284},[4206],{"type":55,"value":4207},"post",{"type":50,"tag":84,"props":4209,"children":4210},{"style":103},[4211],{"type":55,"value":335},{"type":50,"tag":84,"props":4213,"children":4214},{"style":97},[4215],{"type":55,"value":611},{"type":50,"tag":84,"props":4217,"children":4218},{"style":124},[4219],{"type":55,"value":830},{"type":50,"tag":84,"props":4221,"children":4222},{"style":97},[4223],{"type":55,"value":611},{"type":50,"tag":84,"props":4225,"children":4226},{"style":97},[4227],{"type":55,"value":524},{"type":50,"tag":84,"props":4229,"children":4230},{"style":263},[4231],{"type":55,"value":766},{"type":50,"tag":84,"props":4233,"children":4234},{"style":97},[4235],{"type":55,"value":583},{"type":50,"tag":84,"props":4237,"children":4238},{"style":566},[4239],{"type":55,"value":4240},"req",{"type":50,"tag":84,"props":4242,"children":4243},{"style":97},[4244],{"type":55,"value":524},{"type":50,"tag":84,"props":4246,"children":4247},{"style":566},[4248],{"type":55,"value":802},{"type":50,"tag":84,"props":4250,"children":4251},{"style":97},[4252],{"type":55,"value":466},{"type":50,"tag":84,"props":4254,"children":4255},{"style":263},[4256],{"type":55,"value":578},{"type":50,"tag":84,"props":4258,"children":4259},{"style":97},[4260],{"type":55,"value":788},{"type":50,"tag":84,"props":4262,"children":4263},{"class":86,"line":173},[4264,4269,4273,4277,4281,4286,4290,4295,4299],{"type":50,"tag":84,"props":4265,"children":4266},{"style":263},[4267],{"type":55,"value":4268},"  const",{"type":50,"tag":84,"props":4270,"children":4271},{"style":103},[4272],{"type":55,"value":3318},{"type":50,"tag":84,"props":4274,"children":4275},{"style":97},[4276],{"type":55,"value":807},{"type":50,"tag":84,"props":4278,"children":4279},{"style":91},[4280],{"type":55,"value":812},{"type":50,"tag":84,"props":4282,"children":4283},{"style":284},[4284],{"type":55,"value":4285}," generateTxId",{"type":50,"tag":84,"props":4287,"children":4288},{"style":347},[4289],{"type":55,"value":335},{"type":50,"tag":84,"props":4291,"children":4292},{"style":103},[4293],{"type":55,"value":4294},"sql",{"type":50,"tag":84,"props":4296,"children":4297},{"style":347},[4298],{"type":55,"value":3649},{"type":50,"tag":84,"props":4300,"children":4301},{"style":1701},[4302],{"type":55,"value":4303},"\u002F\u002F WRONG: separate transaction\n",{"type":50,"tag":84,"props":4305,"children":4306},{"class":86,"line":211},[4307,4312,4317,4322,4327,4332,4336,4341,4345,4350],{"type":50,"tag":84,"props":4308,"children":4309},{"style":91},[4310],{"type":55,"value":4311},"  await",{"type":50,"tag":84,"props":4313,"children":4314},{"style":284},[4315],{"type":55,"value":4316}," sql",{"type":50,"tag":84,"props":4318,"children":4319},{"style":97},[4320],{"type":55,"value":4321},"`",{"type":50,"tag":84,"props":4323,"children":4324},{"style":124},[4325],{"type":55,"value":4326},"INSERT INTO todos ",{"type":50,"tag":84,"props":4328,"children":4329},{"style":97},[4330],{"type":55,"value":4331},"${",{"type":50,"tag":84,"props":4333,"children":4334},{"style":284},[4335],{"type":55,"value":4294},{"type":50,"tag":84,"props":4337,"children":4338},{"style":103},[4339],{"type":55,"value":4340},"(req",{"type":50,"tag":84,"props":4342,"children":4343},{"style":97},[4344],{"type":55,"value":325},{"type":50,"tag":84,"props":4346,"children":4347},{"style":103},[4348],{"type":55,"value":4349},"body)",{"type":50,"tag":84,"props":4351,"children":4352},{"style":97},[4353],{"type":55,"value":4354},"}`\n",{"type":50,"tag":84,"props":4356,"children":4357},{"class":86,"line":249},[4358,4363,4367,4371,4375,4379,4383,4387],{"type":50,"tag":84,"props":4359,"children":4360},{"style":103},[4361],{"type":55,"value":4362},"  res",{"type":50,"tag":84,"props":4364,"children":4365},{"style":97},[4366],{"type":55,"value":325},{"type":50,"tag":84,"props":4368,"children":4369},{"style":284},[4370],{"type":55,"value":895},{"type":50,"tag":84,"props":4372,"children":4373},{"style":347},[4374],{"type":55,"value":335},{"type":50,"tag":84,"props":4376,"children":4377},{"style":97},[4378],{"type":55,"value":2301},{"type":50,"tag":84,"props":4380,"children":4381},{"style":103},[4382],{"type":55,"value":3318},{"type":50,"tag":84,"props":4384,"children":4385},{"style":97},[4386],{"type":55,"value":111},{"type":50,"tag":84,"props":4388,"children":4389},{"style":347},[4390],{"type":55,"value":657},{"type":50,"tag":84,"props":4392,"children":4393},{"class":86,"line":259},[4394,4398],{"type":50,"tag":84,"props":4395,"children":4396},{"style":97},[4397],{"type":55,"value":652},{"type":50,"tag":84,"props":4399,"children":4400},{"style":103},[4401],{"type":55,"value":657},{"type":50,"tag":51,"props":4403,"children":4404},{},[4405],{"type":55,"value":3556},{"type":50,"tag":72,"props":4407,"children":4409},{"className":74,"code":4408,"language":76,"meta":77,"style":77},"app.post('\u002Fapi\u002Ftodos', async (req, res) => {\n  let txid\n  await sql.begin(async (tx) => {\n    txid = await generateTxId(tx) \u002F\u002F CORRECT: same transaction\n    await tx`INSERT INTO todos ${tx(req.body)}`\n  })\n  res.json({ txid })\n})\n",[4410],{"type":50,"tag":80,"props":4411,"children":4412},{"__ignoreMap":77},[4413,4480,4493,4543,4580,4625,4636,4671],{"type":50,"tag":84,"props":4414,"children":4415},{"class":86,"line":87},[4416,4420,4424,4428,4432,4436,4440,4444,4448,4452,4456,4460,4464,4468,4472,4476],{"type":50,"tag":84,"props":4417,"children":4418},{"style":103},[4419],{"type":55,"value":4198},{"type":50,"tag":84,"props":4421,"children":4422},{"style":97},[4423],{"type":55,"value":325},{"type":50,"tag":84,"props":4425,"children":4426},{"style":284},[4427],{"type":55,"value":4207},{"type":50,"tag":84,"props":4429,"children":4430},{"style":103},[4431],{"type":55,"value":335},{"type":50,"tag":84,"props":4433,"children":4434},{"style":97},[4435],{"type":55,"value":611},{"type":50,"tag":84,"props":4437,"children":4438},{"style":124},[4439],{"type":55,"value":830},{"type":50,"tag":84,"props":4441,"children":4442},{"style":97},[4443],{"type":55,"value":611},{"type":50,"tag":84,"props":4445,"children":4446},{"style":97},[4447],{"type":55,"value":524},{"type":50,"tag":84,"props":4449,"children":4450},{"style":263},[4451],{"type":55,"value":766},{"type":50,"tag":84,"props":4453,"children":4454},{"style":97},[4455],{"type":55,"value":583},{"type":50,"tag":84,"props":4457,"children":4458},{"style":566},[4459],{"type":55,"value":4240},{"type":50,"tag":84,"props":4461,"children":4462},{"style":97},[4463],{"type":55,"value":524},{"type":50,"tag":84,"props":4465,"children":4466},{"style":566},[4467],{"type":55,"value":802},{"type":50,"tag":84,"props":4469,"children":4470},{"style":97},[4471],{"type":55,"value":466},{"type":50,"tag":84,"props":4473,"children":4474},{"style":263},[4475],{"type":55,"value":578},{"type":50,"tag":84,"props":4477,"children":4478},{"style":97},[4479],{"type":55,"value":788},{"type":50,"tag":84,"props":4481,"children":4482},{"class":86,"line":135},[4483,4488],{"type":50,"tag":84,"props":4484,"children":4485},{"style":263},[4486],{"type":55,"value":4487},"  let",{"type":50,"tag":84,"props":4489,"children":4490},{"style":103},[4491],{"type":55,"value":4492}," txid\n",{"type":50,"tag":84,"props":4494,"children":4495},{"class":86,"line":173},[4496,4500,4504,4508,4513,4517,4522,4526,4531,4535,4539],{"type":50,"tag":84,"props":4497,"children":4498},{"style":91},[4499],{"type":55,"value":4311},{"type":50,"tag":84,"props":4501,"children":4502},{"style":103},[4503],{"type":55,"value":4316},{"type":50,"tag":84,"props":4505,"children":4506},{"style":97},[4507],{"type":55,"value":325},{"type":50,"tag":84,"props":4509,"children":4510},{"style":284},[4511],{"type":55,"value":4512},"begin",{"type":50,"tag":84,"props":4514,"children":4515},{"style":347},[4516],{"type":55,"value":335},{"type":50,"tag":84,"props":4518,"children":4519},{"style":263},[4520],{"type":55,"value":4521},"async",{"type":50,"tag":84,"props":4523,"children":4524},{"style":97},[4525],{"type":55,"value":583},{"type":50,"tag":84,"props":4527,"children":4528},{"style":566},[4529],{"type":55,"value":4530},"tx",{"type":50,"tag":84,"props":4532,"children":4533},{"style":97},[4534],{"type":55,"value":466},{"type":50,"tag":84,"props":4536,"children":4537},{"style":263},[4538],{"type":55,"value":578},{"type":50,"tag":84,"props":4540,"children":4541},{"style":97},[4542],{"type":55,"value":788},{"type":50,"tag":84,"props":4544,"children":4545},{"class":86,"line":211},[4546,4551,4555,4559,4563,4567,4571,4575],{"type":50,"tag":84,"props":4547,"children":4548},{"style":103},[4549],{"type":55,"value":4550},"    txid",{"type":50,"tag":84,"props":4552,"children":4553},{"style":97},[4554],{"type":55,"value":807},{"type":50,"tag":84,"props":4556,"children":4557},{"style":91},[4558],{"type":55,"value":812},{"type":50,"tag":84,"props":4560,"children":4561},{"style":284},[4562],{"type":55,"value":4285},{"type":50,"tag":84,"props":4564,"children":4565},{"style":347},[4566],{"type":55,"value":335},{"type":50,"tag":84,"props":4568,"children":4569},{"style":103},[4570],{"type":55,"value":4530},{"type":50,"tag":84,"props":4572,"children":4573},{"style":347},[4574],{"type":55,"value":3649},{"type":50,"tag":84,"props":4576,"children":4577},{"style":1701},[4578],{"type":55,"value":4579},"\u002F\u002F CORRECT: same transaction\n",{"type":50,"tag":84,"props":4581,"children":4582},{"class":86,"line":249},[4583,4588,4593,4597,4601,4605,4609,4613,4617,4621],{"type":50,"tag":84,"props":4584,"children":4585},{"style":91},[4586],{"type":55,"value":4587},"    await",{"type":50,"tag":84,"props":4589,"children":4590},{"style":284},[4591],{"type":55,"value":4592}," tx",{"type":50,"tag":84,"props":4594,"children":4595},{"style":97},[4596],{"type":55,"value":4321},{"type":50,"tag":84,"props":4598,"children":4599},{"style":124},[4600],{"type":55,"value":4326},{"type":50,"tag":84,"props":4602,"children":4603},{"style":97},[4604],{"type":55,"value":4331},{"type":50,"tag":84,"props":4606,"children":4607},{"style":284},[4608],{"type":55,"value":4530},{"type":50,"tag":84,"props":4610,"children":4611},{"style":103},[4612],{"type":55,"value":4340},{"type":50,"tag":84,"props":4614,"children":4615},{"style":97},[4616],{"type":55,"value":325},{"type":50,"tag":84,"props":4618,"children":4619},{"style":103},[4620],{"type":55,"value":4349},{"type":50,"tag":84,"props":4622,"children":4623},{"style":97},[4624],{"type":55,"value":4354},{"type":50,"tag":84,"props":4626,"children":4627},{"class":86,"line":259},[4628,4632],{"type":50,"tag":84,"props":4629,"children":4630},{"style":97},[4631],{"type":55,"value":1394},{"type":50,"tag":84,"props":4633,"children":4634},{"style":347},[4635],{"type":55,"value":657},{"type":50,"tag":84,"props":4637,"children":4638},{"class":86,"line":294},[4639,4643,4647,4651,4655,4659,4663,4667],{"type":50,"tag":84,"props":4640,"children":4641},{"style":103},[4642],{"type":55,"value":4362},{"type":50,"tag":84,"props":4644,"children":4645},{"style":97},[4646],{"type":55,"value":325},{"type":50,"tag":84,"props":4648,"children":4649},{"style":284},[4650],{"type":55,"value":895},{"type":50,"tag":84,"props":4652,"children":4653},{"style":347},[4654],{"type":55,"value":335},{"type":50,"tag":84,"props":4656,"children":4657},{"style":97},[4658],{"type":55,"value":2301},{"type":50,"tag":84,"props":4660,"children":4661},{"style":103},[4662],{"type":55,"value":3318},{"type":50,"tag":84,"props":4664,"children":4665},{"style":97},[4666],{"type":55,"value":111},{"type":50,"tag":84,"props":4668,"children":4669},{"style":347},[4670],{"type":55,"value":657},{"type":50,"tag":84,"props":4672,"children":4673},{"class":86,"line":302},[4674,4678],{"type":50,"tag":84,"props":4675,"children":4676},{"style":97},[4677],{"type":55,"value":652},{"type":50,"tag":84,"props":4679,"children":4680},{"style":103},[4681],{"type":55,"value":657},{"type":50,"tag":51,"props":4683,"children":4684},{},[4685,4691,4693,4699],{"type":50,"tag":80,"props":4686,"children":4688},{"className":4687},[],[4689],{"type":55,"value":4690},"pg_current_xact_id()",{"type":55,"value":4692}," must be queried inside the same SQL transaction as the mutation. Otherwise the txid doesn't match and ",{"type":50,"tag":80,"props":4694,"children":4696},{"className":4695},[],[4697],{"type":55,"value":4698},"awaitTxId",{"type":55,"value":4700}," times out (default 5 seconds).",{"type":50,"tag":51,"props":4702,"children":4703},{},[4704],{"type":55,"value":4705},"Source: docs\u002Fcollections\u002Felectric-collection.md",{"type":50,"tag":2122,"props":4707,"children":4709},{"id":4708},"critical-queryfn-returning-partial-data-without-merging",[4710],{"type":55,"value":4711},"CRITICAL queryFn returning partial data without merging",{"type":50,"tag":51,"props":4713,"children":4714},{},[4715],{"type":55,"value":3406},{"type":50,"tag":72,"props":4717,"children":4719},{"className":74,"code":4718,"language":76,"meta":77,"style":77},"queryCollectionOptions({\n  queryFn: async () => {\n    const newItems = await fetch('\u002Fapi\u002Ftodos?since=' + lastSync)\n    return newItems.json() \u002F\u002F only new items — everything else deleted\n  },\n})\n",[4720],{"type":50,"tag":80,"props":4721,"children":4722},{"__ignoreMap":77},[4723,4738,4765,4820,4848,4855],{"type":50,"tag":84,"props":4724,"children":4725},{"class":86,"line":87},[4726,4730,4734],{"type":50,"tag":84,"props":4727,"children":4728},{"style":284},[4729],{"type":55,"value":1466},{"type":50,"tag":84,"props":4731,"children":4732},{"style":103},[4733],{"type":55,"value":335},{"type":50,"tag":84,"props":4735,"children":4736},{"style":97},[4737],{"type":55,"value":340},{"type":50,"tag":84,"props":4739,"children":4740},{"class":86,"line":135},[4741,4745,4749,4753,4757,4761],{"type":50,"tag":84,"props":4742,"children":4743},{"style":284},[4744],{"type":55,"value":3436},{"type":50,"tag":84,"props":4746,"children":4747},{"style":97},[4748],{"type":55,"value":355},{"type":50,"tag":84,"props":4750,"children":4751},{"style":263},[4752],{"type":55,"value":766},{"type":50,"tag":84,"props":4754,"children":4755},{"style":97},[4756],{"type":55,"value":3449},{"type":50,"tag":84,"props":4758,"children":4759},{"style":263},[4760],{"type":55,"value":578},{"type":50,"tag":84,"props":4762,"children":4763},{"style":97},[4764],{"type":55,"value":788},{"type":50,"tag":84,"props":4766,"children":4767},{"class":86,"line":173},[4768,4772,4777,4781,4785,4789,4793,4797,4802,4806,4811,4816],{"type":50,"tag":84,"props":4769,"children":4770},{"style":263},[4771],{"type":55,"value":3465},{"type":50,"tag":84,"props":4773,"children":4774},{"style":103},[4775],{"type":55,"value":4776}," newItems",{"type":50,"tag":84,"props":4778,"children":4779},{"style":97},[4780],{"type":55,"value":807},{"type":50,"tag":84,"props":4782,"children":4783},{"style":91},[4784],{"type":55,"value":812},{"type":50,"tag":84,"props":4786,"children":4787},{"style":284},[4788],{"type":55,"value":817},{"type":50,"tag":84,"props":4790,"children":4791},{"style":347},[4792],{"type":55,"value":335},{"type":50,"tag":84,"props":4794,"children":4795},{"style":97},[4796],{"type":55,"value":611},{"type":50,"tag":84,"props":4798,"children":4799},{"style":124},[4800],{"type":55,"value":4801},"\u002Fapi\u002Ftodos?since=",{"type":50,"tag":84,"props":4803,"children":4804},{"style":97},[4805],{"type":55,"value":611},{"type":50,"tag":84,"props":4807,"children":4808},{"style":97},[4809],{"type":55,"value":4810}," +",{"type":50,"tag":84,"props":4812,"children":4813},{"style":103},[4814],{"type":55,"value":4815}," lastSync",{"type":50,"tag":84,"props":4817,"children":4818},{"style":347},[4819],{"type":55,"value":657},{"type":50,"tag":84,"props":4821,"children":4822},{"class":86,"line":211},[4823,4827,4831,4835,4839,4843],{"type":50,"tag":84,"props":4824,"children":4825},{"style":91},[4826],{"type":55,"value":3510},{"type":50,"tag":84,"props":4828,"children":4829},{"style":103},[4830],{"type":55,"value":4776},{"type":50,"tag":84,"props":4832,"children":4833},{"style":97},[4834],{"type":55,"value":325},{"type":50,"tag":84,"props":4836,"children":4837},{"style":284},[4838],{"type":55,"value":895},{"type":50,"tag":84,"props":4840,"children":4841},{"style":347},[4842],{"type":55,"value":3527},{"type":50,"tag":84,"props":4844,"children":4845},{"style":1701},[4846],{"type":55,"value":4847},"\u002F\u002F only new items — everything else deleted\n",{"type":50,"tag":84,"props":4849,"children":4850},{"class":86,"line":249},[4851],{"type":50,"tag":84,"props":4852,"children":4853},{"style":97},[4854],{"type":55,"value":3540},{"type":50,"tag":84,"props":4856,"children":4857},{"class":86,"line":259},[4858,4862],{"type":50,"tag":84,"props":4859,"children":4860},{"style":97},[4861],{"type":55,"value":652},{"type":50,"tag":84,"props":4863,"children":4864},{"style":103},[4865],{"type":55,"value":657},{"type":50,"tag":51,"props":4867,"children":4868},{},[4869],{"type":55,"value":3556},{"type":50,"tag":72,"props":4871,"children":4873},{"className":74,"code":4872,"language":76,"meta":77,"style":77},"queryCollectionOptions({\n  queryFn: async (ctx) => {\n    const existing = ctx.queryClient.getQueryData(['todos']) || []\n    const newItems = await fetch('\u002Fapi\u002Ftodos?since=' + lastSync).then((r) =>\n      r.json(),\n    )\n    return [...existing, ...newItems]\n  },\n})\n",[4874],{"type":50,"tag":80,"props":4875,"children":4876},{"__ignoreMap":77},[4877,4892,4927,4997,5077,5101,5109,5148,5155],{"type":50,"tag":84,"props":4878,"children":4879},{"class":86,"line":87},[4880,4884,4888],{"type":50,"tag":84,"props":4881,"children":4882},{"style":284},[4883],{"type":55,"value":1466},{"type":50,"tag":84,"props":4885,"children":4886},{"style":103},[4887],{"type":55,"value":335},{"type":50,"tag":84,"props":4889,"children":4890},{"style":97},[4891],{"type":55,"value":340},{"type":50,"tag":84,"props":4893,"children":4894},{"class":86,"line":135},[4895,4899,4903,4907,4911,4915,4919,4923],{"type":50,"tag":84,"props":4896,"children":4897},{"style":284},[4898],{"type":55,"value":3436},{"type":50,"tag":84,"props":4900,"children":4901},{"style":97},[4902],{"type":55,"value":355},{"type":50,"tag":84,"props":4904,"children":4905},{"style":263},[4906],{"type":55,"value":766},{"type":50,"tag":84,"props":4908,"children":4909},{"style":97},[4910],{"type":55,"value":583},{"type":50,"tag":84,"props":4912,"children":4913},{"style":566},[4914],{"type":55,"value":775},{"type":50,"tag":84,"props":4916,"children":4917},{"style":97},[4918],{"type":55,"value":466},{"type":50,"tag":84,"props":4920,"children":4921},{"style":263},[4922],{"type":55,"value":578},{"type":50,"tag":84,"props":4924,"children":4925},{"style":97},[4926],{"type":55,"value":788},{"type":50,"tag":84,"props":4928,"children":4929},{"class":86,"line":173},[4930,4934,4939,4943,4947,4951,4956,4960,4965,4970,4974,4978,4982,4987,4992],{"type":50,"tag":84,"props":4931,"children":4932},{"style":263},[4933],{"type":55,"value":3465},{"type":50,"tag":84,"props":4935,"children":4936},{"style":103},[4937],{"type":55,"value":4938}," existing",{"type":50,"tag":84,"props":4940,"children":4941},{"style":97},[4942],{"type":55,"value":807},{"type":50,"tag":84,"props":4944,"children":4945},{"style":103},[4946],{"type":55,"value":856},{"type":50,"tag":84,"props":4948,"children":4949},{"style":97},[4950],{"type":55,"value":325},{"type":50,"tag":84,"props":4952,"children":4953},{"style":103},[4954],{"type":55,"value":4955},"queryClient",{"type":50,"tag":84,"props":4957,"children":4958},{"style":97},[4959],{"type":55,"value":325},{"type":50,"tag":84,"props":4961,"children":4962},{"style":284},[4963],{"type":55,"value":4964},"getQueryData",{"type":50,"tag":84,"props":4966,"children":4967},{"style":347},[4968],{"type":55,"value":4969},"([",{"type":50,"tag":84,"props":4971,"children":4972},{"style":97},[4973],{"type":55,"value":611},{"type":50,"tag":84,"props":4975,"children":4976},{"style":124},[4977],{"type":55,"value":735},{"type":50,"tag":84,"props":4979,"children":4980},{"style":97},[4981],{"type":55,"value":611},{"type":50,"tag":84,"props":4983,"children":4984},{"style":347},[4985],{"type":55,"value":4986},"]) ",{"type":50,"tag":84,"props":4988,"children":4989},{"style":97},[4990],{"type":55,"value":4991},"||",{"type":50,"tag":84,"props":4993,"children":4994},{"style":347},[4995],{"type":55,"value":4996}," []\n",{"type":50,"tag":84,"props":4998,"children":4999},{"class":86,"line":211},[5000,5004,5008,5012,5016,5020,5024,5028,5032,5036,5040,5044,5048,5052,5056,5060,5064,5068,5072],{"type":50,"tag":84,"props":5001,"children":5002},{"style":263},[5003],{"type":55,"value":3465},{"type":50,"tag":84,"props":5005,"children":5006},{"style":103},[5007],{"type":55,"value":4776},{"type":50,"tag":84,"props":5009,"children":5010},{"style":97},[5011],{"type":55,"value":807},{"type":50,"tag":84,"props":5013,"children":5014},{"style":91},[5015],{"type":55,"value":812},{"type":50,"tag":84,"props":5017,"children":5018},{"style":284},[5019],{"type":55,"value":817},{"type":50,"tag":84,"props":5021,"children":5022},{"style":347},[5023],{"type":55,"value":335},{"type":50,"tag":84,"props":5025,"children":5026},{"style":97},[5027],{"type":55,"value":611},{"type":50,"tag":84,"props":5029,"children":5030},{"style":124},[5031],{"type":55,"value":4801},{"type":50,"tag":84,"props":5033,"children":5034},{"style":97},[5035],{"type":55,"value":611},{"type":50,"tag":84,"props":5037,"children":5038},{"style":97},[5039],{"type":55,"value":4810},{"type":50,"tag":84,"props":5041,"children":5042},{"style":103},[5043],{"type":55,"value":4815},{"type":50,"tag":84,"props":5045,"children":5046},{"style":347},[5047],{"type":55,"value":466},{"type":50,"tag":84,"props":5049,"children":5050},{"style":97},[5051],{"type":55,"value":325},{"type":50,"tag":84,"props":5053,"children":5054},{"style":284},[5055],{"type":55,"value":4022},{"type":50,"tag":84,"props":5057,"children":5058},{"style":347},[5059],{"type":55,"value":335},{"type":50,"tag":84,"props":5061,"children":5062},{"style":97},[5063],{"type":55,"value":335},{"type":50,"tag":84,"props":5065,"children":5066},{"style":566},[5067],{"type":55,"value":4035},{"type":50,"tag":84,"props":5069,"children":5070},{"style":97},[5071],{"type":55,"value":466},{"type":50,"tag":84,"props":5073,"children":5074},{"style":263},[5075],{"type":55,"value":5076}," =>\n",{"type":50,"tag":84,"props":5078,"children":5079},{"class":86,"line":249},[5080,5085,5089,5093,5097],{"type":50,"tag":84,"props":5081,"children":5082},{"style":103},[5083],{"type":55,"value":5084},"      r",{"type":50,"tag":84,"props":5086,"children":5087},{"style":97},[5088],{"type":55,"value":325},{"type":50,"tag":84,"props":5090,"children":5091},{"style":284},[5092],{"type":55,"value":895},{"type":50,"tag":84,"props":5094,"children":5095},{"style":347},[5096],{"type":55,"value":373},{"type":50,"tag":84,"props":5098,"children":5099},{"style":97},[5100],{"type":55,"value":378},{"type":50,"tag":84,"props":5102,"children":5103},{"class":86,"line":259},[5104],{"type":50,"tag":84,"props":5105,"children":5106},{"style":347},[5107],{"type":55,"value":5108},"    )\n",{"type":50,"tag":84,"props":5110,"children":5111},{"class":86,"line":294},[5112,5116,5120,5125,5130,5134,5139,5144],{"type":50,"tag":84,"props":5113,"children":5114},{"style":91},[5115],{"type":55,"value":3510},{"type":50,"tag":84,"props":5117,"children":5118},{"style":347},[5119],{"type":55,"value":726},{"type":50,"tag":84,"props":5121,"children":5122},{"style":97},[5123],{"type":55,"value":5124},"...",{"type":50,"tag":84,"props":5126,"children":5127},{"style":103},[5128],{"type":55,"value":5129},"existing",{"type":50,"tag":84,"props":5131,"children":5132},{"style":97},[5133],{"type":55,"value":524},{"type":50,"tag":84,"props":5135,"children":5136},{"style":97},[5137],{"type":55,"value":5138}," ...",{"type":50,"tag":84,"props":5140,"children":5141},{"style":103},[5142],{"type":55,"value":5143},"newItems",{"type":50,"tag":84,"props":5145,"children":5146},{"style":347},[5147],{"type":55,"value":1195},{"type":50,"tag":84,"props":5149,"children":5150},{"class":86,"line":302},[5151],{"type":50,"tag":84,"props":5152,"children":5153},{"style":97},[5154],{"type":55,"value":3540},{"type":50,"tag":84,"props":5156,"children":5157},{"class":86,"line":343},[5158,5162],{"type":50,"tag":84,"props":5159,"children":5160},{"style":97},[5161],{"type":55,"value":652},{"type":50,"tag":84,"props":5163,"children":5164},{"style":103},[5165],{"type":55,"value":657},{"type":50,"tag":51,"props":5167,"children":5168},{},[5169,5174],{"type":50,"tag":80,"props":5170,"children":5172},{"className":5171},[],[5173],{"type":55,"value":3739},{"type":55,"value":5175}," result replaces all collection data. For incremental fetches, merge with existing data.",{"type":50,"tag":51,"props":5177,"children":5178},{},[5179],{"type":55,"value":3754},{"type":50,"tag":2122,"props":5181,"children":5183},{"id":5182},"high-using-async-schema-validation",[5184],{"type":55,"value":5185},"HIGH Using async schema validation",{"type":50,"tag":51,"props":5187,"children":5188},{},[5189],{"type":55,"value":3406},{"type":50,"tag":72,"props":5191,"children":5193},{"className":74,"code":5192,"language":76,"meta":77,"style":77},"const schema = z.object({\n  email: z.string().refine(async (val) => {\n    const exists = await checkEmail(val)\n    return !exists\n  }),\n})\n",[5194],{"type":50,"tag":80,"props":5195,"children":5196},{"__ignoreMap":77},[5197,5232,5297,5334,5351,5366],{"type":50,"tag":84,"props":5198,"children":5199},{"class":86,"line":87},[5200,5204,5208,5212,5216,5220,5224,5228],{"type":50,"tag":84,"props":5201,"children":5202},{"style":263},[5203],{"type":55,"value":266},{"type":50,"tag":84,"props":5205,"children":5206},{"style":103},[5207],{"type":55,"value":2418},{"type":50,"tag":84,"props":5209,"children":5210},{"style":97},[5211],{"type":55,"value":276},{"type":50,"tag":84,"props":5213,"children":5214},{"style":103},[5215],{"type":55,"value":225},{"type":50,"tag":84,"props":5217,"children":5218},{"style":97},[5219],{"type":55,"value":325},{"type":50,"tag":84,"props":5221,"children":5222},{"style":284},[5223],{"type":55,"value":330},{"type":50,"tag":84,"props":5225,"children":5226},{"style":103},[5227],{"type":55,"value":335},{"type":50,"tag":84,"props":5229,"children":5230},{"style":97},[5231],{"type":55,"value":340},{"type":50,"tag":84,"props":5233,"children":5234},{"class":86,"line":135},[5235,5240,5244,5248,5252,5256,5260,5264,5269,5273,5277,5281,5285,5289,5293],{"type":50,"tag":84,"props":5236,"children":5237},{"style":347},[5238],{"type":55,"value":5239},"  email",{"type":50,"tag":84,"props":5241,"children":5242},{"style":97},[5243],{"type":55,"value":355},{"type":50,"tag":84,"props":5245,"children":5246},{"style":103},[5247],{"type":55,"value":225},{"type":50,"tag":84,"props":5249,"children":5250},{"style":97},[5251],{"type":55,"value":325},{"type":50,"tag":84,"props":5253,"children":5254},{"style":284},[5255],{"type":55,"value":404},{"type":50,"tag":84,"props":5257,"children":5258},{"style":103},[5259],{"type":55,"value":373},{"type":50,"tag":84,"props":5261,"children":5262},{"style":97},[5263],{"type":55,"value":325},{"type":50,"tag":84,"props":5265,"children":5266},{"style":284},[5267],{"type":55,"value":5268},"refine",{"type":50,"tag":84,"props":5270,"children":5271},{"style":103},[5272],{"type":55,"value":335},{"type":50,"tag":84,"props":5274,"children":5275},{"style":263},[5276],{"type":55,"value":4521},{"type":50,"tag":84,"props":5278,"children":5279},{"style":97},[5280],{"type":55,"value":583},{"type":50,"tag":84,"props":5282,"children":5283},{"style":566},[5284],{"type":55,"value":569},{"type":50,"tag":84,"props":5286,"children":5287},{"style":97},[5288],{"type":55,"value":466},{"type":50,"tag":84,"props":5290,"children":5291},{"style":263},[5292],{"type":55,"value":578},{"type":50,"tag":84,"props":5294,"children":5295},{"style":97},[5296],{"type":55,"value":788},{"type":50,"tag":84,"props":5298,"children":5299},{"class":86,"line":173},[5300,5304,5309,5313,5317,5322,5326,5330],{"type":50,"tag":84,"props":5301,"children":5302},{"style":263},[5303],{"type":55,"value":3465},{"type":50,"tag":84,"props":5305,"children":5306},{"style":103},[5307],{"type":55,"value":5308}," exists",{"type":50,"tag":84,"props":5310,"children":5311},{"style":97},[5312],{"type":55,"value":807},{"type":50,"tag":84,"props":5314,"children":5315},{"style":91},[5316],{"type":55,"value":812},{"type":50,"tag":84,"props":5318,"children":5319},{"style":284},[5320],{"type":55,"value":5321}," checkEmail",{"type":50,"tag":84,"props":5323,"children":5324},{"style":347},[5325],{"type":55,"value":335},{"type":50,"tag":84,"props":5327,"children":5328},{"style":103},[5329],{"type":55,"value":569},{"type":50,"tag":84,"props":5331,"children":5332},{"style":347},[5333],{"type":55,"value":657},{"type":50,"tag":84,"props":5335,"children":5336},{"class":86,"line":211},[5337,5341,5346],{"type":50,"tag":84,"props":5338,"children":5339},{"style":91},[5340],{"type":55,"value":3510},{"type":50,"tag":84,"props":5342,"children":5343},{"style":97},[5344],{"type":55,"value":5345}," !",{"type":50,"tag":84,"props":5347,"children":5348},{"style":103},[5349],{"type":55,"value":5350},"exists\n",{"type":50,"tag":84,"props":5352,"children":5353},{"class":86,"line":249},[5354,5358,5362],{"type":50,"tag":84,"props":5355,"children":5356},{"style":97},[5357],{"type":55,"value":1394},{"type":50,"tag":84,"props":5359,"children":5360},{"style":103},[5361],{"type":55,"value":466},{"type":50,"tag":84,"props":5363,"children":5364},{"style":97},[5365],{"type":55,"value":378},{"type":50,"tag":84,"props":5367,"children":5368},{"class":86,"line":259},[5369,5373],{"type":50,"tag":84,"props":5370,"children":5371},{"style":97},[5372],{"type":55,"value":652},{"type":50,"tag":84,"props":5374,"children":5375},{"style":103},[5376],{"type":55,"value":657},{"type":50,"tag":51,"props":5378,"children":5379},{},[5380],{"type":55,"value":3556},{"type":50,"tag":72,"props":5382,"children":5384},{"className":74,"code":5383,"language":76,"meta":77,"style":77},"const schema = z.object({\n  email: z.string().email(),\n})\n\u002F\u002F Do async validation in the mutation handler instead\n",[5385],{"type":50,"tag":80,"props":5386,"children":5387},{"__ignoreMap":77},[5388,5423,5467,5478],{"type":50,"tag":84,"props":5389,"children":5390},{"class":86,"line":87},[5391,5395,5399,5403,5407,5411,5415,5419],{"type":50,"tag":84,"props":5392,"children":5393},{"style":263},[5394],{"type":55,"value":266},{"type":50,"tag":84,"props":5396,"children":5397},{"style":103},[5398],{"type":55,"value":2418},{"type":50,"tag":84,"props":5400,"children":5401},{"style":97},[5402],{"type":55,"value":276},{"type":50,"tag":84,"props":5404,"children":5405},{"style":103},[5406],{"type":55,"value":225},{"type":50,"tag":84,"props":5408,"children":5409},{"style":97},[5410],{"type":55,"value":325},{"type":50,"tag":84,"props":5412,"children":5413},{"style":284},[5414],{"type":55,"value":330},{"type":50,"tag":84,"props":5416,"children":5417},{"style":103},[5418],{"type":55,"value":335},{"type":50,"tag":84,"props":5420,"children":5421},{"style":97},[5422],{"type":55,"value":340},{"type":50,"tag":84,"props":5424,"children":5425},{"class":86,"line":135},[5426,5430,5434,5438,5442,5446,5450,5454,5459,5463],{"type":50,"tag":84,"props":5427,"children":5428},{"style":347},[5429],{"type":55,"value":5239},{"type":50,"tag":84,"props":5431,"children":5432},{"style":97},[5433],{"type":55,"value":355},{"type":50,"tag":84,"props":5435,"children":5436},{"style":103},[5437],{"type":55,"value":225},{"type":50,"tag":84,"props":5439,"children":5440},{"style":97},[5441],{"type":55,"value":325},{"type":50,"tag":84,"props":5443,"children":5444},{"style":284},[5445],{"type":55,"value":404},{"type":50,"tag":84,"props":5447,"children":5448},{"style":103},[5449],{"type":55,"value":373},{"type":50,"tag":84,"props":5451,"children":5452},{"style":97},[5453],{"type":55,"value":325},{"type":50,"tag":84,"props":5455,"children":5456},{"style":284},[5457],{"type":55,"value":5458},"email",{"type":50,"tag":84,"props":5460,"children":5461},{"style":103},[5462],{"type":55,"value":373},{"type":50,"tag":84,"props":5464,"children":5465},{"style":97},[5466],{"type":55,"value":378},{"type":50,"tag":84,"props":5468,"children":5469},{"class":86,"line":173},[5470,5474],{"type":50,"tag":84,"props":5471,"children":5472},{"style":97},[5473],{"type":55,"value":652},{"type":50,"tag":84,"props":5475,"children":5476},{"style":103},[5477],{"type":55,"value":657},{"type":50,"tag":84,"props":5479,"children":5480},{"class":86,"line":211},[5481],{"type":50,"tag":84,"props":5482,"children":5483},{"style":1701},[5484],{"type":55,"value":5485},"\u002F\u002F Do async validation in the mutation handler instead\n",{"type":50,"tag":51,"props":5487,"children":5488},{},[5489,5491,5497],{"type":55,"value":5490},"Schema validation must be synchronous. Async validation throws ",{"type":50,"tag":80,"props":5492,"children":5494},{"className":5493},[],[5495],{"type":55,"value":5496},"SchemaMustBeSynchronousError",{"type":55,"value":5498}," at mutation time.",{"type":50,"tag":51,"props":5500,"children":5501},{},[5502],{"type":55,"value":5503},"Source: packages\u002Fdb\u002Fsrc\u002Fcollection\u002Fmutations.ts:101",{"type":50,"tag":2122,"props":5505,"children":5507},{"id":5506},"high-getkey-returning-undefined-for-some-items",[5508],{"type":55,"value":5509},"HIGH getKey returning undefined for some items",{"type":50,"tag":51,"props":5511,"children":5512},{},[5513],{"type":55,"value":3406},{"type":50,"tag":72,"props":5515,"children":5517},{"className":74,"code":5516,"language":76,"meta":77,"style":77},"createCollection(\n  queryCollectionOptions({\n    getKey: (item) => item.metadata.id, \u002F\u002F undefined if metadata missing\n  }),\n)\n",[5518],{"type":50,"tag":80,"props":5519,"children":5520},{"__ignoreMap":77},[5521,5532,5547,5604,5619],{"type":50,"tag":84,"props":5522,"children":5523},{"class":86,"line":87},[5524,5528],{"type":50,"tag":84,"props":5525,"children":5526},{"style":284},[5527],{"type":55,"value":1975},{"type":50,"tag":84,"props":5529,"children":5530},{"style":103},[5531],{"type":55,"value":691},{"type":50,"tag":84,"props":5533,"children":5534},{"class":86,"line":135},[5535,5539,5543],{"type":50,"tag":84,"props":5536,"children":5537},{"style":284},[5538],{"type":55,"value":700},{"type":50,"tag":84,"props":5540,"children":5541},{"style":103},[5542],{"type":55,"value":335},{"type":50,"tag":84,"props":5544,"children":5545},{"style":97},[5546],{"type":55,"value":340},{"type":50,"tag":84,"props":5548,"children":5549},{"class":86,"line":173},[5550,5554,5558,5562,5566,5570,5574,5578,5582,5587,5591,5595,5599],{"type":50,"tag":84,"props":5551,"children":5552},{"style":284},[5553],{"type":55,"value":930},{"type":50,"tag":84,"props":5555,"children":5556},{"style":97},[5557],{"type":55,"value":355},{"type":50,"tag":84,"props":5559,"children":5560},{"style":97},[5561],{"type":55,"value":583},{"type":50,"tag":84,"props":5563,"children":5564},{"style":566},[5565],{"type":55,"value":943},{"type":50,"tag":84,"props":5567,"children":5568},{"style":97},[5569],{"type":55,"value":466},{"type":50,"tag":84,"props":5571,"children":5572},{"style":263},[5573],{"type":55,"value":578},{"type":50,"tag":84,"props":5575,"children":5576},{"style":103},[5577],{"type":55,"value":956},{"type":50,"tag":84,"props":5579,"children":5580},{"style":97},[5581],{"type":55,"value":325},{"type":50,"tag":84,"props":5583,"children":5584},{"style":103},[5585],{"type":55,"value":5586},"metadata",{"type":50,"tag":84,"props":5588,"children":5589},{"style":97},[5590],{"type":55,"value":325},{"type":50,"tag":84,"props":5592,"children":5593},{"style":103},[5594],{"type":55,"value":965},{"type":50,"tag":84,"props":5596,"children":5597},{"style":97},[5598],{"type":55,"value":524},{"type":50,"tag":84,"props":5600,"children":5601},{"style":1701},[5602],{"type":55,"value":5603}," \u002F\u002F undefined if metadata missing\n",{"type":50,"tag":84,"props":5605,"children":5606},{"class":86,"line":211},[5607,5611,5615],{"type":50,"tag":84,"props":5608,"children":5609},{"style":97},[5610],{"type":55,"value":1394},{"type":50,"tag":84,"props":5612,"children":5613},{"style":103},[5614],{"type":55,"value":466},{"type":50,"tag":84,"props":5616,"children":5617},{"style":97},[5618],{"type":55,"value":378},{"type":50,"tag":84,"props":5620,"children":5621},{"class":86,"line":249},[5622],{"type":50,"tag":84,"props":5623,"children":5624},{"style":103},[5625],{"type":55,"value":657},{"type":50,"tag":51,"props":5627,"children":5628},{},[5629],{"type":55,"value":3556},{"type":50,"tag":72,"props":5631,"children":5633},{"className":74,"code":5632,"language":76,"meta":77,"style":77},"createCollection(\n  queryCollectionOptions({\n    getKey: (item) => item.id, \u002F\u002F always present\n  }),\n)\n",[5634],{"type":50,"tag":80,"props":5635,"children":5636},{"__ignoreMap":77},[5637,5648,5663,5711,5726],{"type":50,"tag":84,"props":5638,"children":5639},{"class":86,"line":87},[5640,5644],{"type":50,"tag":84,"props":5641,"children":5642},{"style":284},[5643],{"type":55,"value":1975},{"type":50,"tag":84,"props":5645,"children":5646},{"style":103},[5647],{"type":55,"value":691},{"type":50,"tag":84,"props":5649,"children":5650},{"class":86,"line":135},[5651,5655,5659],{"type":50,"tag":84,"props":5652,"children":5653},{"style":284},[5654],{"type":55,"value":700},{"type":50,"tag":84,"props":5656,"children":5657},{"style":103},[5658],{"type":55,"value":335},{"type":50,"tag":84,"props":5660,"children":5661},{"style":97},[5662],{"type":55,"value":340},{"type":50,"tag":84,"props":5664,"children":5665},{"class":86,"line":173},[5666,5670,5674,5678,5682,5686,5690,5694,5698,5702,5706],{"type":50,"tag":84,"props":5667,"children":5668},{"style":284},[5669],{"type":55,"value":930},{"type":50,"tag":84,"props":5671,"children":5672},{"style":97},[5673],{"type":55,"value":355},{"type":50,"tag":84,"props":5675,"children":5676},{"style":97},[5677],{"type":55,"value":583},{"type":50,"tag":84,"props":5679,"children":5680},{"style":566},[5681],{"type":55,"value":943},{"type":50,"tag":84,"props":5683,"children":5684},{"style":97},[5685],{"type":55,"value":466},{"type":50,"tag":84,"props":5687,"children":5688},{"style":263},[5689],{"type":55,"value":578},{"type":50,"tag":84,"props":5691,"children":5692},{"style":103},[5693],{"type":55,"value":956},{"type":50,"tag":84,"props":5695,"children":5696},{"style":97},[5697],{"type":55,"value":325},{"type":50,"tag":84,"props":5699,"children":5700},{"style":103},[5701],{"type":55,"value":965},{"type":50,"tag":84,"props":5703,"children":5704},{"style":97},[5705],{"type":55,"value":524},{"type":50,"tag":84,"props":5707,"children":5708},{"style":1701},[5709],{"type":55,"value":5710}," \u002F\u002F always present\n",{"type":50,"tag":84,"props":5712,"children":5713},{"class":86,"line":211},[5714,5718,5722],{"type":50,"tag":84,"props":5715,"children":5716},{"style":97},[5717],{"type":55,"value":1394},{"type":50,"tag":84,"props":5719,"children":5720},{"style":103},[5721],{"type":55,"value":466},{"type":50,"tag":84,"props":5723,"children":5724},{"style":97},[5725],{"type":55,"value":378},{"type":50,"tag":84,"props":5727,"children":5728},{"class":86,"line":249},[5729],{"type":50,"tag":84,"props":5730,"children":5731},{"style":103},[5732],{"type":55,"value":657},{"type":50,"tag":51,"props":5734,"children":5735},{},[5736,5742,5744,5750],{"type":50,"tag":80,"props":5737,"children":5739},{"className":5738},[],[5740],{"type":55,"value":5741},"getKey",{"type":55,"value":5743}," must return a defined value for every item. Throws ",{"type":50,"tag":80,"props":5745,"children":5747},{"className":5746},[],[5748],{"type":55,"value":5749},"UndefinedKeyError",{"type":55,"value":5751}," otherwise.",{"type":50,"tag":51,"props":5753,"children":5754},{},[5755],{"type":55,"value":5756},"Source: packages\u002Fdb\u002Fsrc\u002Fcollection\u002Fmutations.ts:148",{"type":50,"tag":2122,"props":5758,"children":5760},{"id":5759},"high-tinput-not-a-superset-of-toutput-with-schema-transforms",[5761],{"type":55,"value":5762},"HIGH TInput not a superset of TOutput with schema transforms",{"type":50,"tag":51,"props":5764,"children":5765},{},[5766],{"type":55,"value":3406},{"type":50,"tag":72,"props":5768,"children":5770},{"className":74,"code":5769,"language":76,"meta":77,"style":77},"const schema = z.object({\n  created_at: z.string().transform((val) => new Date(val)),\n})\n\u002F\u002F update() fails — draft.created_at is Date but schema only accepts string\n",[5771],{"type":50,"tag":80,"props":5772,"children":5773},{"__ignoreMap":77},[5774,5809,5881,5892],{"type":50,"tag":84,"props":5775,"children":5776},{"class":86,"line":87},[5777,5781,5785,5789,5793,5797,5801,5805],{"type":50,"tag":84,"props":5778,"children":5779},{"style":263},[5780],{"type":55,"value":266},{"type":50,"tag":84,"props":5782,"children":5783},{"style":103},[5784],{"type":55,"value":2418},{"type":50,"tag":84,"props":5786,"children":5787},{"style":97},[5788],{"type":55,"value":276},{"type":50,"tag":84,"props":5790,"children":5791},{"style":103},[5792],{"type":55,"value":225},{"type":50,"tag":84,"props":5794,"children":5795},{"style":97},[5796],{"type":55,"value":325},{"type":50,"tag":84,"props":5798,"children":5799},{"style":284},[5800],{"type":55,"value":330},{"type":50,"tag":84,"props":5802,"children":5803},{"style":103},[5804],{"type":55,"value":335},{"type":50,"tag":84,"props":5806,"children":5807},{"style":97},[5808],{"type":55,"value":340},{"type":50,"tag":84,"props":5810,"children":5811},{"class":86,"line":135},[5812,5816,5820,5824,5828,5832,5836,5840,5844,5848,5852,5856,5860,5864,5868,5872,5877],{"type":50,"tag":84,"props":5813,"children":5814},{"style":347},[5815],{"type":55,"value":479},{"type":50,"tag":84,"props":5817,"children":5818},{"style":97},[5819],{"type":55,"value":355},{"type":50,"tag":84,"props":5821,"children":5822},{"style":103},[5823],{"type":55,"value":225},{"type":50,"tag":84,"props":5825,"children":5826},{"style":97},[5827],{"type":55,"value":325},{"type":50,"tag":84,"props":5829,"children":5830},{"style":284},[5831],{"type":55,"value":404},{"type":50,"tag":84,"props":5833,"children":5834},{"style":103},[5835],{"type":55,"value":373},{"type":50,"tag":84,"props":5837,"children":5838},{"style":97},[5839],{"type":55,"value":325},{"type":50,"tag":84,"props":5841,"children":5842},{"style":284},[5843],{"type":55,"value":555},{"type":50,"tag":84,"props":5845,"children":5846},{"style":103},[5847],{"type":55,"value":335},{"type":50,"tag":84,"props":5849,"children":5850},{"style":97},[5851],{"type":55,"value":335},{"type":50,"tag":84,"props":5853,"children":5854},{"style":566},[5855],{"type":55,"value":569},{"type":50,"tag":84,"props":5857,"children":5858},{"style":97},[5859],{"type":55,"value":466},{"type":50,"tag":84,"props":5861,"children":5862},{"style":263},[5863],{"type":55,"value":578},{"type":50,"tag":84,"props":5865,"children":5866},{"style":97},[5867],{"type":55,"value":281},{"type":50,"tag":84,"props":5869,"children":5870},{"style":284},[5871],{"type":55,"value":625},{"type":50,"tag":84,"props":5873,"children":5874},{"style":103},[5875],{"type":55,"value":5876},"(val))",{"type":50,"tag":84,"props":5878,"children":5879},{"style":97},[5880],{"type":55,"value":378},{"type":50,"tag":84,"props":5882,"children":5883},{"class":86,"line":173},[5884,5888],{"type":50,"tag":84,"props":5885,"children":5886},{"style":97},[5887],{"type":55,"value":652},{"type":50,"tag":84,"props":5889,"children":5890},{"style":103},[5891],{"type":55,"value":657},{"type":50,"tag":84,"props":5893,"children":5894},{"class":86,"line":211},[5895],{"type":50,"tag":84,"props":5896,"children":5897},{"style":1701},[5898],{"type":55,"value":5899},"\u002F\u002F update() fails — draft.created_at is Date but schema only accepts string\n",{"type":50,"tag":51,"props":5901,"children":5902},{},[5903],{"type":55,"value":3556},{"type":50,"tag":72,"props":5905,"children":5907},{"className":74,"code":5906,"language":76,"meta":77,"style":77},"const schema = z.object({\n  created_at: z\n    .union([z.string(), z.date()])\n    .transform((val) => (typeof val === 'string' ? new Date(val) : val)),\n})\n",[5908],{"type":50,"tag":80,"props":5909,"children":5910},{"__ignoreMap":77},[5911,5946,5961,6008,6095],{"type":50,"tag":84,"props":5912,"children":5913},{"class":86,"line":87},[5914,5918,5922,5926,5930,5934,5938,5942],{"type":50,"tag":84,"props":5915,"children":5916},{"style":263},[5917],{"type":55,"value":266},{"type":50,"tag":84,"props":5919,"children":5920},{"style":103},[5921],{"type":55,"value":2418},{"type":50,"tag":84,"props":5923,"children":5924},{"style":97},[5925],{"type":55,"value":276},{"type":50,"tag":84,"props":5927,"children":5928},{"style":103},[5929],{"type":55,"value":225},{"type":50,"tag":84,"props":5931,"children":5932},{"style":97},[5933],{"type":55,"value":325},{"type":50,"tag":84,"props":5935,"children":5936},{"style":284},[5937],{"type":55,"value":330},{"type":50,"tag":84,"props":5939,"children":5940},{"style":103},[5941],{"type":55,"value":335},{"type":50,"tag":84,"props":5943,"children":5944},{"style":97},[5945],{"type":55,"value":340},{"type":50,"tag":84,"props":5947,"children":5948},{"class":86,"line":135},[5949,5953,5957],{"type":50,"tag":84,"props":5950,"children":5951},{"style":347},[5952],{"type":55,"value":479},{"type":50,"tag":84,"props":5954,"children":5955},{"style":97},[5956],{"type":55,"value":355},{"type":50,"tag":84,"props":5958,"children":5959},{"style":103},[5960],{"type":55,"value":488},{"type":50,"tag":84,"props":5962,"children":5963},{"class":86,"line":173},[5964,5968,5972,5976,5980,5984,5988,5992,5996,6000,6004],{"type":50,"tag":84,"props":5965,"children":5966},{"style":97},[5967],{"type":55,"value":497},{"type":50,"tag":84,"props":5969,"children":5970},{"style":284},[5971],{"type":55,"value":502},{"type":50,"tag":84,"props":5973,"children":5974},{"style":103},[5975],{"type":55,"value":507},{"type":50,"tag":84,"props":5977,"children":5978},{"style":97},[5979],{"type":55,"value":325},{"type":50,"tag":84,"props":5981,"children":5982},{"style":284},[5983],{"type":55,"value":404},{"type":50,"tag":84,"props":5985,"children":5986},{"style":103},[5987],{"type":55,"value":373},{"type":50,"tag":84,"props":5989,"children":5990},{"style":97},[5991],{"type":55,"value":524},{"type":50,"tag":84,"props":5993,"children":5994},{"style":103},[5995],{"type":55,"value":225},{"type":50,"tag":84,"props":5997,"children":5998},{"style":97},[5999],{"type":55,"value":325},{"type":50,"tag":84,"props":6001,"children":6002},{"style":284},[6003],{"type":55,"value":537},{"type":50,"tag":84,"props":6005,"children":6006},{"style":103},[6007],{"type":55,"value":542},{"type":50,"tag":84,"props":6009,"children":6010},{"class":86,"line":211},[6011,6015,6019,6023,6027,6031,6035,6039,6043,6047,6051,6055,6059,6063,6067,6071,6075,6079,6083,6087,6091],{"type":50,"tag":84,"props":6012,"children":6013},{"style":97},[6014],{"type":55,"value":497},{"type":50,"tag":84,"props":6016,"children":6017},{"style":284},[6018],{"type":55,"value":555},{"type":50,"tag":84,"props":6020,"children":6021},{"style":103},[6022],{"type":55,"value":335},{"type":50,"tag":84,"props":6024,"children":6025},{"style":97},[6026],{"type":55,"value":335},{"type":50,"tag":84,"props":6028,"children":6029},{"style":566},[6030],{"type":55,"value":569},{"type":50,"tag":84,"props":6032,"children":6033},{"style":97},[6034],{"type":55,"value":466},{"type":50,"tag":84,"props":6036,"children":6037},{"style":263},[6038],{"type":55,"value":578},{"type":50,"tag":84,"props":6040,"children":6041},{"style":103},[6042],{"type":55,"value":583},{"type":50,"tag":84,"props":6044,"children":6045},{"style":97},[6046],{"type":55,"value":588},{"type":50,"tag":84,"props":6048,"children":6049},{"style":103},[6050],{"type":55,"value":593},{"type":50,"tag":84,"props":6052,"children":6053},{"style":97},[6054],{"type":55,"value":598},{"type":50,"tag":84,"props":6056,"children":6057},{"style":97},[6058],{"type":55,"value":121},{"type":50,"tag":84,"props":6060,"children":6061},{"style":124},[6062],{"type":55,"value":404},{"type":50,"tag":84,"props":6064,"children":6065},{"style":97},[6066],{"type":55,"value":611},{"type":50,"tag":84,"props":6068,"children":6069},{"style":97},[6070],{"type":55,"value":616},{"type":50,"tag":84,"props":6072,"children":6073},{"style":97},[6074],{"type":55,"value":281},{"type":50,"tag":84,"props":6076,"children":6077},{"style":284},[6078],{"type":55,"value":625},{"type":50,"tag":84,"props":6080,"children":6081},{"style":103},[6082],{"type":55,"value":630},{"type":50,"tag":84,"props":6084,"children":6085},{"style":97},[6086],{"type":55,"value":355},{"type":50,"tag":84,"props":6088,"children":6089},{"style":103},[6090],{"type":55,"value":639},{"type":50,"tag":84,"props":6092,"children":6093},{"style":97},[6094],{"type":55,"value":378},{"type":50,"tag":84,"props":6096,"children":6097},{"class":86,"line":249},[6098,6102],{"type":50,"tag":84,"props":6099,"children":6100},{"style":97},[6101],{"type":55,"value":652},{"type":50,"tag":84,"props":6103,"children":6104},{"style":103},[6105],{"type":55,"value":657},{"type":50,"tag":51,"props":6107,"children":6108},{},[6109,6111,6116,6118,6123],{"type":55,"value":6110},"When a schema transforms types, ",{"type":50,"tag":80,"props":6112,"children":6114},{"className":6113},[],[6115],{"type":55,"value":2737},{"type":55,"value":6117}," must accept both the pre-transform and post-transform types for ",{"type":50,"tag":80,"props":6119,"children":6121},{"className":6120},[],[6122],{"type":55,"value":2753},{"type":55,"value":6124}," to work with the draft proxy.",{"type":50,"tag":51,"props":6126,"children":6127},{},[6128],{"type":55,"value":6129},"Source: docs\u002Fguides\u002Fschemas.md",{"type":50,"tag":2122,"props":6131,"children":6133},{"id":6132},"high-react-native-missing-cryptorandomuuid-polyfill",[6134],{"type":55,"value":6135},"HIGH React Native missing crypto.randomUUID polyfill",{"type":50,"tag":51,"props":6137,"children":6138},{},[6139,6141,6147,6149,6155],{"type":55,"value":6140},"TanStack DB uses ",{"type":50,"tag":80,"props":6142,"children":6144},{"className":6143},[],[6145],{"type":55,"value":6146},"crypto.randomUUID()",{"type":55,"value":6148}," internally. React Native doesn't provide this. Install ",{"type":50,"tag":80,"props":6150,"children":6152},{"className":6151},[],[6153],{"type":55,"value":6154},"react-native-random-uuid",{"type":55,"value":6156}," and import it at your app entry point.",{"type":50,"tag":51,"props":6158,"children":6159},{},[6160],{"type":55,"value":4165},{"type":50,"tag":2122,"props":6162,"children":6164},{"id":6163},"medium-providing-both-explicit-type-parameter-and-schema",[6165],{"type":55,"value":6166},"MEDIUM Providing both explicit type parameter and schema",{"type":50,"tag":51,"props":6168,"children":6169},{},[6170],{"type":55,"value":3406},{"type":50,"tag":72,"props":6172,"children":6174},{"className":74,"code":6173,"language":76,"meta":77,"style":77},"createCollection\u003CTodo>(queryCollectionOptions({ schema: todoSchema, ... }))\n",[6175],{"type":50,"tag":80,"props":6176,"children":6177},{"__ignoreMap":77},[6178],{"type":50,"tag":84,"props":6179,"children":6180},{"class":86,"line":87},[6181,6185,6190,6196,6201,6205,6209,6213,6217,6222,6226,6230,6234,6238,6242],{"type":50,"tag":84,"props":6182,"children":6183},{"style":284},[6184],{"type":55,"value":1975},{"type":50,"tag":84,"props":6186,"children":6187},{"style":97},[6188],{"type":55,"value":6189},"\u003C",{"type":50,"tag":84,"props":6191,"children":6193},{"style":6192},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[6194],{"type":55,"value":6195},"Todo",{"type":50,"tag":84,"props":6197,"children":6198},{"style":97},[6199],{"type":55,"value":6200},">",{"type":50,"tag":84,"props":6202,"children":6203},{"style":103},[6204],{"type":55,"value":335},{"type":50,"tag":84,"props":6206,"children":6207},{"style":284},[6208],{"type":55,"value":1466},{"type":50,"tag":84,"props":6210,"children":6211},{"style":103},[6212],{"type":55,"value":335},{"type":50,"tag":84,"props":6214,"children":6215},{"style":97},[6216],{"type":55,"value":2301},{"type":50,"tag":84,"props":6218,"children":6219},{"style":347},[6220],{"type":55,"value":6221}," schema",{"type":50,"tag":84,"props":6223,"children":6224},{"style":97},[6225],{"type":55,"value":355},{"type":50,"tag":84,"props":6227,"children":6228},{"style":103},[6229],{"type":55,"value":987},{"type":50,"tag":84,"props":6231,"children":6232},{"style":97},[6233],{"type":55,"value":524},{"type":50,"tag":84,"props":6235,"children":6236},{"style":97},[6237],{"type":55,"value":5138},{"type":50,"tag":84,"props":6239,"children":6240},{"style":97},[6241],{"type":55,"value":111},{"type":50,"tag":84,"props":6243,"children":6244},{"style":103},[6245],{"type":55,"value":6246},"))\n",{"type":50,"tag":51,"props":6248,"children":6249},{},[6250],{"type":55,"value":3556},{"type":50,"tag":72,"props":6252,"children":6254},{"className":74,"code":6253,"language":76,"meta":77,"style":77},"createCollection(queryCollectionOptions({ schema: todoSchema, ... }))\n",[6255],{"type":50,"tag":80,"props":6256,"children":6257},{"__ignoreMap":77},[6258],{"type":50,"tag":84,"props":6259,"children":6260},{"class":86,"line":87},[6261,6265,6269,6273,6277,6281,6285,6289,6293,6297,6301,6305],{"type":50,"tag":84,"props":6262,"children":6263},{"style":284},[6264],{"type":55,"value":1975},{"type":50,"tag":84,"props":6266,"children":6267},{"style":103},[6268],{"type":55,"value":335},{"type":50,"tag":84,"props":6270,"children":6271},{"style":284},[6272],{"type":55,"value":1466},{"type":50,"tag":84,"props":6274,"children":6275},{"style":103},[6276],{"type":55,"value":335},{"type":50,"tag":84,"props":6278,"children":6279},{"style":97},[6280],{"type":55,"value":2301},{"type":50,"tag":84,"props":6282,"children":6283},{"style":347},[6284],{"type":55,"value":6221},{"type":50,"tag":84,"props":6286,"children":6287},{"style":97},[6288],{"type":55,"value":355},{"type":50,"tag":84,"props":6290,"children":6291},{"style":103},[6292],{"type":55,"value":987},{"type":50,"tag":84,"props":6294,"children":6295},{"style":97},[6296],{"type":55,"value":524},{"type":50,"tag":84,"props":6298,"children":6299},{"style":97},[6300],{"type":55,"value":5138},{"type":50,"tag":84,"props":6302,"children":6303},{"style":97},[6304],{"type":55,"value":111},{"type":50,"tag":84,"props":6306,"children":6307},{"style":103},[6308],{"type":55,"value":6246},{"type":50,"tag":51,"props":6310,"children":6311},{},[6312],{"type":55,"value":6313},"When a schema is provided, the collection infers types from it. An explicit generic creates conflicting type constraints.",{"type":50,"tag":51,"props":6315,"children":6316},{},[6317],{"type":55,"value":4165},{"type":50,"tag":2122,"props":6319,"children":6321},{"id":6320},"medium-direct-writes-overridden-by-next-query-sync",[6322],{"type":55,"value":6323},"MEDIUM Direct writes overridden by next query sync",{"type":50,"tag":51,"props":6325,"children":6326},{},[6327],{"type":55,"value":3406},{"type":50,"tag":72,"props":6329,"children":6331},{"className":74,"code":6330,"language":76,"meta":77,"style":77},"todoCollection.utils.writeInsert(newItem)\n\u002F\u002F Next queryFn execution replaces all data, losing the direct write\n",[6332],{"type":50,"tag":80,"props":6333,"children":6334},{"__ignoreMap":77},[6335,6366],{"type":50,"tag":84,"props":6336,"children":6337},{"class":86,"line":87},[6338,6343,6347,6352,6356,6361],{"type":50,"tag":84,"props":6339,"children":6340},{"style":103},[6341],{"type":55,"value":6342},"todoCollection",{"type":50,"tag":84,"props":6344,"children":6345},{"style":97},[6346],{"type":55,"value":325},{"type":50,"tag":84,"props":6348,"children":6349},{"style":103},[6350],{"type":55,"value":6351},"utils",{"type":50,"tag":84,"props":6353,"children":6354},{"style":97},[6355],{"type":55,"value":325},{"type":50,"tag":84,"props":6357,"children":6358},{"style":284},[6359],{"type":55,"value":6360},"writeInsert",{"type":50,"tag":84,"props":6362,"children":6363},{"style":103},[6364],{"type":55,"value":6365},"(newItem)\n",{"type":50,"tag":84,"props":6367,"children":6368},{"class":86,"line":135},[6369],{"type":50,"tag":84,"props":6370,"children":6371},{"style":1701},[6372],{"type":55,"value":6373},"\u002F\u002F Next queryFn execution replaces all data, losing the direct write\n",{"type":50,"tag":51,"props":6375,"children":6376},{},[6377],{"type":55,"value":3556},{"type":50,"tag":72,"props":6379,"children":6381},{"className":74,"code":6380,"language":76,"meta":77,"style":77},"todoCollection.utils.writeInsert(newItem)\n\u002F\u002F Use staleTime to prevent immediate refetch\n\u002F\u002F Or return { refetch: false } from mutation handlers\n",[6382],{"type":50,"tag":80,"props":6383,"children":6384},{"__ignoreMap":77},[6385,6412,6420],{"type":50,"tag":84,"props":6386,"children":6387},{"class":86,"line":87},[6388,6392,6396,6400,6404,6408],{"type":50,"tag":84,"props":6389,"children":6390},{"style":103},[6391],{"type":55,"value":6342},{"type":50,"tag":84,"props":6393,"children":6394},{"style":97},[6395],{"type":55,"value":325},{"type":50,"tag":84,"props":6397,"children":6398},{"style":103},[6399],{"type":55,"value":6351},{"type":50,"tag":84,"props":6401,"children":6402},{"style":97},[6403],{"type":55,"value":325},{"type":50,"tag":84,"props":6405,"children":6406},{"style":284},[6407],{"type":55,"value":6360},{"type":50,"tag":84,"props":6409,"children":6410},{"style":103},[6411],{"type":55,"value":6365},{"type":50,"tag":84,"props":6413,"children":6414},{"class":86,"line":135},[6415],{"type":50,"tag":84,"props":6416,"children":6417},{"style":1701},[6418],{"type":55,"value":6419},"\u002F\u002F Use staleTime to prevent immediate refetch\n",{"type":50,"tag":84,"props":6421,"children":6422},{"class":86,"line":173},[6423],{"type":50,"tag":84,"props":6424,"children":6425},{"style":1701},[6426],{"type":55,"value":6427},"\u002F\u002F Or return { refetch: false } from mutation handlers\n",{"type":50,"tag":51,"props":6429,"children":6430},{},[6431,6433,6438],{"type":55,"value":6432},"Direct writes update the collection immediately, but the next ",{"type":50,"tag":80,"props":6434,"children":6436},{"className":6435},[],[6437],{"type":55,"value":3739},{"type":55,"value":6439}," returns complete server state which overwrites them.",{"type":50,"tag":51,"props":6441,"children":6442},{},[6443],{"type":55,"value":3754},{"type":50,"tag":65,"props":6445,"children":6447},{"id":6446},"references",[6448],{"type":55,"value":6449},"References",{"type":50,"tag":6451,"props":6452,"children":6453},"ul",{},[6454,6464,6472,6481,6490,6499,6508],{"type":50,"tag":6455,"props":6456,"children":6457},"li",{},[6458],{"type":50,"tag":1869,"props":6459,"children":6461},{"href":6460},"references\u002Fquery-adapter.md",[6462],{"type":55,"value":6463},"TanStack Query adapter",{"type":50,"tag":6455,"props":6465,"children":6466},{},[6467],{"type":50,"tag":1869,"props":6468,"children":6469},{"href":3384},[6470],{"type":55,"value":6471},"ElectricSQL adapter",{"type":50,"tag":6455,"props":6473,"children":6474},{},[6475],{"type":50,"tag":1869,"props":6476,"children":6478},{"href":6477},"references\u002Fpowersync-adapter.md",[6479],{"type":55,"value":6480},"PowerSync adapter",{"type":50,"tag":6455,"props":6482,"children":6483},{},[6484],{"type":50,"tag":1869,"props":6485,"children":6487},{"href":6486},"references\u002Frxdb-adapter.md",[6488],{"type":55,"value":6489},"RxDB adapter",{"type":50,"tag":6455,"props":6491,"children":6492},{},[6493],{"type":50,"tag":1869,"props":6494,"children":6496},{"href":6495},"references\u002Ftrailbase-adapter.md",[6497],{"type":55,"value":6498},"TrailBase adapter",{"type":50,"tag":6455,"props":6500,"children":6501},{},[6502],{"type":50,"tag":1869,"props":6503,"children":6505},{"href":6504},"references\u002Flocal-adapters.md",[6506],{"type":55,"value":6507},"Local adapters (local-only, localStorage)",{"type":50,"tag":6455,"props":6509,"children":6510},{},[6511],{"type":50,"tag":1869,"props":6512,"children":6514},{"href":6513},"references\u002Fschema-patterns.md",[6515],{"type":55,"value":6516},"Schema validation patterns",{"type":50,"tag":51,"props":6518,"children":6519},{},[6520],{"type":55,"value":6521},"See also: db-core\u002Fmutations-optimistic\u002FSKILL.md — mutation handlers configured here execute during mutations.",{"type":50,"tag":51,"props":6523,"children":6524},{},[6525],{"type":55,"value":6526},"See also: db-core\u002Fcustom-adapter\u002FSKILL.md — for building your own adapter.",{"type":50,"tag":6528,"props":6529,"children":6530},"style",{},[6531],{"type":55,"value":6532},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":6534,"total":6676},[6535,6551,6563,6575,6590,6602,6612,6622,6635,6645,6656,6666],{"slug":6536,"name":6536,"fn":6537,"description":6538,"org":6539,"tags":6540,"stars":6548,"repoUrl":6549,"updatedAt":6550},"aggregation","perform data aggregation in TanStack Table","Aggregate TanStack Table columns independently of grouping, including grand totals, caller-selected row totals, multiple keyed aggregations, custom context-based definitions, grouped merges, manual values, and worker constraints.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6541,6544,6547],{"name":6542,"slug":6543,"type":16},"Data Analysis","data-analysis",{"name":6545,"slug":6546,"type":16},"Frontend","frontend",{"name":10,"slug":9,"type":16},28175,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Ftable","2026-07-30T05:25:59.429787",{"slug":6552,"name":6552,"fn":6553,"description":6554,"org":6555,"tags":6556,"stars":6548,"repoUrl":6549,"updatedAt":6562},"api-not-found","diagnose TanStack Table API errors","Diagnose missing TanStack Table v9 exports, options, state slices, and instance methods. Load before inventing an API when code sees a type error, undefined feature method, absent object key, adapter mismatch, or v8-shaped example.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6557,6560,6561],{"name":6558,"slug":6559,"type":16},"Debugging","debugging",{"name":6545,"slug":6546,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:05.418735",{"slug":6564,"name":6564,"fn":6565,"description":6566,"org":6567,"tags":6568,"stars":6548,"repoUrl":6549,"updatedAt":6574},"cell-selection","select rectangular cell ranges in tables","Select rectangular cell ranges with cellSelectionFeature: two-corner range state keyed by row and column id, mousedown\u002Fmouseenter handlers, selection edges, render-order resolution under pinning, and autoResetCellSelection. Load when ranges widen unexpectedly after sorting or column reordering, when a drag re-renders the whole table, or when building copy-to-clipboard from a selection.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6569,6570,6571],{"name":6542,"slug":6543,"type":16},{"name":10,"slug":9,"type":16},{"name":6572,"slug":6573,"type":16},"UI Components","ui-components","2026-07-30T05:25:38.403427",{"slug":6576,"name":6576,"fn":6577,"description":6578,"org":6579,"tags":6580,"stars":6548,"repoUrl":6549,"updatedAt":6589},"client-vs-server","manage TanStack Table data pipelines","Choose client or server ownership for filtering, grouping, sorting, expanding, and pagination in TanStack Table v9. Load for manual* flags, mixed pipelines, server counts, or deciding which dataset each row-model stage receives.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6581,6584,6585,6588],{"name":6582,"slug":6583,"type":16},"Data Pipeline","data-pipeline",{"name":6545,"slug":6546,"type":16},{"name":6586,"slug":6587,"type":16},"Performance","performance",{"name":10,"slug":9,"type":16},"2026-07-30T05:25:45.400104",{"slug":6591,"name":6591,"fn":6592,"description":6593,"org":6594,"tags":6595,"stars":6548,"repoUrl":6549,"updatedAt":6601},"column-faceting","build faceted filter UIs","Build faceted filter UIs with columnFacetingFeature, facetedRowModel, facetedUniqueValues, and facetedMinMaxValues. Load for facet counts, numeric ranges, own-filter exclusion, or server-page facet completeness.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6596,6599,6600],{"name":6597,"slug":6598,"type":16},"Data Visualization","data-visualization",{"name":6545,"slug":6546,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:41.397257",{"slug":6603,"name":6603,"fn":6604,"description":6605,"org":6606,"tags":6607,"stars":6548,"repoUrl":6549,"updatedAt":6611},"column-filtering","implement column filtering in TanStack Table","Filter columns with columnFilteringFeature, filteredRowModel, filterFns, filterMeta, nested-row direction, and manualFiltering. Load for accessor compatibility, controlled filter updaters, fuzzy metadata, or client\u002Fserver ownership.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6608,6609,6610],{"name":6542,"slug":6543,"type":16},{"name":6545,"slug":6546,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:53.391632",{"slug":6613,"name":6613,"fn":6614,"description":6615,"org":6616,"tags":6617,"stars":6548,"repoUrl":6549,"updatedAt":6621},"column-ordering","manage TanStack Table column ordering","Control TanStack Table v9 leaf columnOrder with stable IDs while accounting for pinning regions, visibility, and groupedColumnMode precedence. Load for drag-and-drop columns or rendered order that differs from state.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6618,6619,6620],{"name":6545,"slug":6546,"type":16},{"name":10,"slug":9,"type":16},{"name":6572,"slug":6573,"type":16},"2026-07-30T05:26:03.37801",{"slug":6623,"name":6623,"fn":6624,"description":6625,"org":6626,"tags":6627,"stars":6548,"repoUrl":6549,"updatedAt":6634},"column-pinning","configure column pinning in TanStack Table","Pin columns into logical start, center, and end regions with columnPinningFeature and renderer-owned sticky CSS. Load for RTL offsets, z-index, backgrounds, overflow, widths, gaps, or overlaps.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6628,6631,6632,6633],{"name":6629,"slug":6630,"type":16},"CSS","css",{"name":6545,"slug":6546,"type":16},{"name":10,"slug":9,"type":16},{"name":6572,"slug":6573,"type":16},"2026-07-30T05:25:55.377366",{"slug":6636,"name":6636,"fn":6637,"description":6638,"org":6639,"tags":6640,"stars":6548,"repoUrl":6549,"updatedAt":6644},"column-resizing","implement column resizing in TanStack Table","Wire columnResizingFeature, header.getResizeHandler, resize mode and direction, pointer or touch events, and performant CSS-variable updates. Load when resize state changes but widths do not, or large tables resize slowly.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6641,6642,6643],{"name":6545,"slug":6546,"type":16},{"name":10,"slug":9,"type":16},{"name":6572,"slug":6573,"type":16},"2026-07-30T05:25:51.400011",{"slug":6646,"name":6646,"fn":6647,"description":6648,"org":6649,"tags":6650,"stars":6548,"repoUrl":6549,"updatedAt":6655},"column-sizing","configure column sizing in TanStack Table","Use columnSizingFeature numeric size, minSize, maxSize, getSize, getStart, getAfter, and total-size APIs in table, grid, or flex CSS. Load for auto or percentage misconceptions and sizing\u002Fpinning layout mismatch.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6651,6652,6653,6654],{"name":6629,"slug":6630,"type":16},{"name":6545,"slug":6546,"type":16},{"name":10,"slug":9,"type":16},{"name":6572,"slug":6573,"type":16},"2026-07-30T05:25:48.703799",{"slug":6657,"name":6657,"fn":6658,"description":6659,"org":6660,"tags":6661,"stars":6548,"repoUrl":6549,"updatedAt":6665},"column-visibility","manage column visibility in TanStack Table","Hide columns with columnVisibilityFeature while rendering visibility-aware header, column, and cell collections. Load when hidden columns remain in the DOM, false-versus-absent state is confused, or enableHiding is misunderstood.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6662,6663,6664],{"name":6545,"slug":6546,"type":16},{"name":10,"slug":9,"type":16},{"name":6572,"slug":6573,"type":16},"2026-07-30T05:25:47.367943",{"slug":6667,"name":6667,"fn":6668,"description":6669,"org":6670,"tags":6671,"stars":6548,"repoUrl":6549,"updatedAt":6675},"core","build data grids with TanStack Table","Use TanStack Table v9 as a headless data-grid state and row-processing engine. Load for first-table architecture, stable data and columns, row numbering with getDisplayIndex, semantic rendering, framework adapter choice, or deciding what Table owns versus the renderer.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6672,6673,6674],{"name":6542,"slug":6543,"type":16},{"name":6545,"slug":6546,"type":16},{"name":6572,"slug":6573,"type":16},"2026-07-30T05:25:52.366295",125,{"items":6678,"total":491},[6679,6693,6703,6709,6722,6734,6745],{"slug":6680,"name":6680,"fn":6681,"description":6682,"org":6683,"tags":6684,"stars":21,"repoUrl":22,"updatedAt":6692},"angular-db","integrate TanStack DB with Angular","Angular bindings for TanStack DB. injectLiveQuery inject function with Angular signals (Signal\u003CT>) for all return values. Reactive params pattern ({ params: () => T, query: ({ params, q }) => QueryBuilder }) for dynamic queries. Must be called in injection context. Angular 17+ control flow (@if, @for) and signal inputs supported. Import from @tanstack\u002Fangular-db (re-exports all of @tanstack\u002Fdb).\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6685,6688,6689],{"name":6686,"slug":6687,"type":16},"Angular","angular",{"name":14,"slug":15,"type":16},{"name":6690,"slug":6691,"type":16},"TypeScript","typescript","2026-07-16T06:01:16.345046",{"slug":6694,"name":6694,"fn":6695,"description":6696,"org":6697,"tags":6698,"stars":21,"repoUrl":22,"updatedAt":6702},"db-core","manage database collections with TanStack DB","TanStack DB core concepts: createCollection with queryCollectionOptions, electricCollectionOptions, powerSyncCollectionOptions, rxdbCollectionOptions, trailbaseCollectionOptions, localOnlyCollectionOptions. Live queries via query builder (from, where, join, select, groupBy, orderBy, limit). Optimistic mutations with draft proxy (collection.insert, collection.update, collection.delete). createOptimisticAction, createTransaction, createPacedMutations. Entry point for all TanStack DB skills.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6699,6700,6701],{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},{"name":10,"slug":9,"type":16},"2026-07-17T06:06:40.214285",{"slug":4,"name":5,"fn":6,"description":7,"org":6704,"tags":6705,"stars":21,"repoUrl":22,"updatedAt":23},{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6706,6707,6708],{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},{"name":10,"slug":9,"type":16},{"slug":6710,"name":6711,"fn":6712,"description":6713,"org":6714,"tags":6715,"stars":21,"repoUrl":22,"updatedAt":6721},"db-corecustom-adapter","db-core\u002Fcustom-adapter","build custom TanStack collection adapters","Building custom collection adapters for new backends. SyncConfig interface: sync function receiving begin, write, commit, markReady, truncate, metadata primitives. ChangeMessage format (insert, update, delete). loadSubset for on-demand sync. LoadSubsetOptions (where, orderBy, limit, cursor). Expression parsing: parseWhereExpression, parseOrderByExpression, extractSimpleComparisons, parseLoadSubsetOptions. Collection options creator pattern. rowUpdateMode (partial vs full). Subscription lifecycle and cleanup functions. Persisted sync metadata API (metadata.row and metadata.collection) for storing per-row and per-collection adapter state.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6716,6717,6720],{"name":14,"slug":15,"type":16},{"name":6718,"slug":6719,"type":16},"Engineering","engineering",{"name":10,"slug":9,"type":16},"2026-07-16T06:04:06.862485",{"slug":6723,"name":6724,"fn":6725,"description":6726,"org":6727,"tags":6728,"stars":21,"repoUrl":22,"updatedAt":6733},"db-corelive-queries","db-core\u002Flive-queries","build live queries with TanStack DB","Query builder fluent API: from, where, join, leftJoin, rightJoin, innerJoin, fullJoin, select, fn.select, groupBy, having, orderBy, limit, offset, distinct, findOne. Operators: eq, gt, gte, lt, lte, like, ilike, inArray, isNull, isUndefined, and, or, not. Aggregates: count, sum, avg, min, max. String functions: upper, lower, length, concat. Utility: coalesce, caseWhen. Math: add. $selected namespace. createLiveQueryCollection. Derived collections. Predicate push-down. Incremental view maintenance via differential dataflow (d2ts). Virtual properties ($synced, $origin, $key, $collectionId). Includes subqueries for hierarchical data. toArray and concat(toArray(...)) scalar includes. queryOnce for one-shot queries. createEffect for reactive side effects (onEnter, onUpdate, onExit, onBatch).\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6729,6730,6732],{"name":14,"slug":15,"type":16},{"name":6731,"slug":4294,"type":16},"SQL",{"name":10,"slug":9,"type":16},"2026-07-16T06:04:08.757365",{"slug":6735,"name":6736,"fn":6737,"description":6738,"org":6739,"tags":6740,"stars":21,"repoUrl":22,"updatedAt":6744},"db-coremutations-optimistic","db-core\u002Fmutations-optimistic","manage optimistic mutations in TanStack DB","collection.insert, collection.update (Immer-style draft proxy), collection.delete. createOptimisticAction (onMutate + mutationFn). createPacedMutations with debounceStrategy, throttleStrategy, queueStrategy. createTransaction, getActiveTransaction, ambient transaction context. Transaction lifecycle (pending\u002Fpersisting\u002Fcompleted\u002Ffailed). Mutation merging. onInsert\u002FonUpdate\u002FonDelete handlers. PendingMutation type. Transaction.isPersisted.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6741,6742,6743],{"name":14,"slug":15,"type":16},{"name":6545,"slug":6546,"type":16},{"name":10,"slug":9,"type":16},"2026-07-26T05:48:57.301803",{"slug":6746,"name":6747,"fn":6748,"description":6749,"org":6750,"tags":6751,"stars":21,"repoUrl":22,"updatedAt":6760},"db-corepersistence","db-core\u002Fpersistence","implement SQLite-backed persistence for TanStack DB","SQLite-backed persistence for TanStack DB collections. persistedCollectionOptions wraps any adapter (Electric, Query, PowerSync, or local-only) with durable local storage. Platform adapters: browser (WA-SQLite OPFS), React Native (op-sqlite), Expo (expo-sqlite), Electron (IPC), Node (better-sqlite3), Capacitor, Tauri, Cloudflare Durable Objects. Multi-tab\u002Fmulti-process coordination via BrowserCollectionCoordinator \u002F ElectronCollectionCoordinator \u002F SingleProcessCoordinator. schemaVersion for migration resets. Local-only mode for offline-first without a server.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6752,6753,6756,6759],{"name":14,"slug":15,"type":16},{"name":6754,"slug":6755,"type":16},"Persistence","persistence",{"name":6757,"slug":6758,"type":16},"SQLite","sqlite",{"name":10,"slug":9,"type":16},"2026-07-17T06:06:39.182084"]