[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-tanstack-db-corepersistence":3,"mdc--tv1lgs-key":35,"related-repo-tanstack-db-corepersistence":2887,"related-org-tanstack-db-corepersistence":2972},{"slug":4,"name":5,"fn":6,"description":7,"org":8,"tags":12,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":30,"sourceUrl":33,"mdContent":34},"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},"tanstack","TanStack","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftanstack.png",[13,17,20,21],{"name":14,"slug":15,"type":16},"Database","database","tag",{"name":18,"slug":19,"type":16},"Persistence","persistence",{"name":10,"slug":9,"type":16},{"name":22,"slug":23,"type":16},"SQLite","sqlite",3811,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Fdb","2026-07-17T06:06:39.182084",null,245,[],{"repoUrl":25,"stars":24,"forks":28,"topics":31,"description":32},[],"The reactive client store for your API.","https:\u002F\u002Fgithub.com\u002FTanStack\u002Fdb\u002Ftree\u002FHEAD\u002Fpackages\u002Fdb\u002Fskills\u002Fdb-core\u002Fpersistence","---\nname: db-core\u002Fpersistence\ndescription: >\n  SQLite-backed persistence for TanStack DB collections. persistedCollectionOptions\n  wraps any adapter (Electric, Query, PowerSync, or local-only) with durable local\n  storage. Platform adapters: browser (WA-SQLite OPFS), React Native (op-sqlite),\n  Expo (expo-sqlite), Electron (IPC), Node (better-sqlite3), Capacitor, Tauri,\n  Cloudflare Durable Objects. Multi-tab\u002Fmulti-process coordination via\n  BrowserCollectionCoordinator \u002F ElectronCollectionCoordinator \u002F\n  SingleProcessCoordinator. schemaVersion for migration resets. Local-only mode\n  for offline-first without a server.\ntype: sub-skill\nlibrary: db\nlibrary_version: '0.6.0'\nsources:\n  - 'TanStack\u002Fdb:packages\u002Fdb-sqlite-persistence-core\u002Fsrc\u002Fpersisted.ts'\n  - 'TanStack\u002Fdb:packages\u002Fbrowser-db-sqlite-persistence\u002Fsrc\u002Findex.ts'\n  - 'TanStack\u002Fdb:packages\u002Freact-native-db-sqlite-persistence\u002Fsrc\u002Findex.ts'\n  - 'TanStack\u002Fdb:packages\u002Fexpo-db-sqlite-persistence\u002Fsrc\u002Findex.ts'\n  - 'TanStack\u002Fdb:packages\u002Felectron-db-sqlite-persistence\u002Fsrc\u002Findex.ts'\n  - 'TanStack\u002Fdb:packages\u002Fnode-db-sqlite-persistence\u002Fsrc\u002Findex.ts'\n  - 'TanStack\u002Fdb:examples\u002Freact\u002Foffline-transactions\u002Fsrc\u002Fdb\u002Fpersisted-todos.ts'\n  - 'TanStack\u002Fdb:examples\u002Freact-native\u002Fshopping-list\u002Fsrc\u002Fdb\u002Fcollections.ts'\n---\n\nThis skill builds on db-core and db-core\u002Fcollection-setup. Read those first.\n\n# SQLite Persistence\n\nTanStack DB persistence adds a durable SQLite-backed layer to any collection. Data survives page reloads, app restarts, and offline periods. The server remains authoritative for synced collections -- persistence provides a local cache that hydrates instantly.\n\n## Choosing a Platform Package\n\n| Platform       | Package                                                      | Create function                              |\n| -------------- | ------------------------------------------------------------ | -------------------------------------------- |\n| Browser (OPFS) | `@tanstack\u002Fbrowser-db-sqlite-persistence`                    | `createBrowserWASQLitePersistence`           |\n| React Native   | `@tanstack\u002Freact-native-db-sqlite-persistence`               | `createReactNativeSQLitePersistence`         |\n| Expo           | `@tanstack\u002Fexpo-db-sqlite-persistence`                       | `createExpoSQLitePersistence`                |\n| Electron       | `@tanstack\u002Felectron-db-sqlite-persistence`                   | `createElectronSQLitePersistence` (renderer) |\n| Node.js        | `@tanstack\u002Fnode-db-sqlite-persistence`                       | `createNodeSQLitePersistence`                |\n| Capacitor      | `@tanstack\u002Fcapacitor-db-sqlite-persistence`                  | `createCapacitorSQLitePersistence`           |\n| Tauri          | `@tanstack\u002Ftauri-db-sqlite-persistence`                      | `createTauriSQLitePersistence`               |\n| Cloudflare DO  | `@tanstack\u002Fcloudflare-durable-objects-db-sqlite-persistence` | `createCloudflareDOSQLitePersistence`        |\n\nAll platform packages re-export `persistedCollectionOptions` from the core.\n\n## Local-Only Persistence (No Server)\n\nFor purely local data with no sync backend:\n\n```ts\nimport { createCollection } from '@tanstack\u002Freact-db'\nimport {\n  BrowserCollectionCoordinator,\n  createBrowserWASQLitePersistence,\n  openBrowserWASQLiteOPFSDatabase,\n  persistedCollectionOptions,\n} from '@tanstack\u002Fbrowser-db-sqlite-persistence'\n\nconst database = await openBrowserWASQLiteOPFSDatabase({\n  databaseName: 'my-app.sqlite',\n})\n\nconst coordinator = new BrowserCollectionCoordinator({\n  dbName: 'my-app',\n})\n\nconst persistence = createBrowserWASQLitePersistence({\n  database,\n  coordinator,\n})\n\nconst draftsCollection = createCollection(\n  persistedCollectionOptions\u003CDraft, string>({\n    id: 'drafts',\n    getKey: (d) => d.id,\n    persistence,\n    schemaVersion: 1,\n  }),\n)\n```\n\nLocal-only collections provide `collection.utils.acceptMutations()` for applying mutations directly.\n\n## Synced Persistence (Wrapping an Adapter)\n\nSpread an existing adapter's options into `persistedCollectionOptions` to add persistence on top of sync:\n\n```ts\nimport { createCollection } from '@tanstack\u002Freact-db'\nimport { electricCollectionOptions } from '@tanstack\u002Felectric-db-collection'\nimport {\n  createReactNativeSQLitePersistence,\n  persistedCollectionOptions,\n} from '@tanstack\u002Freact-native-db-sqlite-persistence'\n\nconst persistence = createReactNativeSQLitePersistence({ database })\n\nconst todosCollection = createCollection(\n  persistedCollectionOptions({\n    ...electricCollectionOptions({\n      id: 'todos',\n      shapeOptions: { url: '\u002Fapi\u002Felectric\u002Ftodos' },\n      getKey: (item) => item.id,\n    }),\n    persistence,\n    schemaVersion: 1,\n  }),\n)\n```\n\nThis works with any adapter: `electricCollectionOptions`, `queryCollectionOptions`, `powerSyncCollectionOptions`, etc. The `persistedCollectionOptions` wrapper intercepts the sync layer to persist data as it flows through.\n\n## Multi-Tab \u002F Multi-Process Coordination\n\nCoordinators handle leader election and cross-instance communication so only one tab\u002Fprocess owns the database writer.\n\n| Platform                              | Coordinator                     | Mechanism                                      |\n| ------------------------------------- | ------------------------------- | ---------------------------------------------- |\n| Browser                               | `BrowserCollectionCoordinator`  | BroadcastChannel + Web Locks                   |\n| Electron                              | `ElectronCollectionCoordinator` | IPC (main holds DB, renderer accesses via RPC) |\n| Single-process (RN, Expo, Node, etc.) | `SingleProcessCoordinator`      | No-op (always leader)                          |\n\nBrowser example:\n\n```ts\nimport { BrowserCollectionCoordinator } from '@tanstack\u002Fbrowser-db-sqlite-persistence'\n\nconst coordinator = new BrowserCollectionCoordinator({\n  dbName: 'my-app',\n})\n\n\u002F\u002F Pass to persistence\nconst persistence = createBrowserWASQLitePersistence({ database, coordinator })\n\n\u002F\u002F Cleanup on shutdown\ncoordinator.dispose()\n```\n\nElectron requires setup in both processes:\n\n```ts\n\u002F\u002F Main process\nimport { exposeElectronSQLitePersistence } from '@tanstack\u002Felectron-db-sqlite-persistence'\nexposeElectronSQLitePersistence({ persistence, ipcMain })\n\n\u002F\u002F Renderer process\nimport {\n  createElectronSQLitePersistence,\n  ElectronCollectionCoordinator,\n} from '@tanstack\u002Felectron-db-sqlite-persistence'\n\nconst coordinator = new ElectronCollectionCoordinator({ dbName: 'my-app' })\nconst persistence = createElectronSQLitePersistence({\n  ipcRenderer: window.electron.ipcRenderer,\n  coordinator,\n})\n```\n\n## Schema Versioning\n\n`schemaVersion` tracks the shape of persisted data. When the stored version doesn't match the code, the collection resets (drops and reloads from server for synced collections, or throws for local-only).\n\n```ts\npersistedCollectionOptions({\n  \u002F\u002F ...\n  schemaVersion: 2, \u002F\u002F bump when you change the data shape\n})\n```\n\nThere is no custom migration function -- a version mismatch triggers a full reset. For synced collections this is safe because the server re-supplies the data.\n\n## Key Options\n\n| Option          | Type                             | Description                                              |\n| --------------- | -------------------------------- | -------------------------------------------------------- |\n| `persistence`   | `PersistedCollectionPersistence` | Platform adapter + coordinator                           |\n| `schemaVersion` | `number`                         | Data version (default 1). Bump on schema changes         |\n| `id`            | `string`                         | Required for local-only. Collection identifier in SQLite |\n\n## Common Mistakes\n\n### CRITICAL Using local-only persistence without an `id`\n\nWrong:\n\n```ts\npersistedCollectionOptions({\n  getKey: (d) => d.id,\n  persistence,\n  \u002F\u002F missing id — generates random UUID each session, data won't persist across reloads\n})\n```\n\nCorrect:\n\n```ts\npersistedCollectionOptions({\n  id: 'drafts',\n  getKey: (d) => d.id,\n  persistence,\n})\n```\n\nWithout an explicit `id`, the code generates a random UUID each session, so persisted data is silently abandoned on every reload. Local-only persisted collections must always provide an `id`. Synced collections derive it from the adapter config.\n\n### HIGH Forgetting the coordinator in multi-tab apps\n\nWrong:\n\n```ts\nconst persistence = createBrowserWASQLitePersistence({ database })\n\u002F\u002F No coordinator — concurrent tabs corrupt the database\n```\n\nCorrect:\n\n```ts\nconst coordinator = new BrowserCollectionCoordinator({ dbName: 'my-app' })\nconst persistence = createBrowserWASQLitePersistence({ database, coordinator })\n```\n\nWithout a coordinator, multiple browser tabs write to SQLite concurrently, causing data corruption. Always use `BrowserCollectionCoordinator` in browser environments.\n\n### HIGH Not bumping schemaVersion after changing data shape\n\nIf you add, remove, or rename fields in your collection type but keep the same `schemaVersion`, the persisted SQLite data will have the old shape. For synced collections, bump the version to trigger a reset and re-sync.\n\n### MEDIUM Not disposing the coordinator on cleanup\n\n```ts\n\u002F\u002F On app shutdown or hot module reload\ncoordinator.dispose()\nawait database.close?.()\n```\n\nFailing to dispose leaks BroadcastChannel subscriptions and Web Lock handles.\n\nSee also: db-core\u002Fcollection-setup\u002FSKILL.md — for adapter selection and collection configuration.\n\nSee also: offline\u002FSKILL.md — for offline transaction queueing (complements persistence).\n",{"data":36,"body":49},{"name":5,"description":7,"type":37,"library":38,"library_version":39,"sources":40},"sub-skill","db","0.6.0",[41,42,43,44,45,46,47,48],"TanStack\u002Fdb:packages\u002Fdb-sqlite-persistence-core\u002Fsrc\u002Fpersisted.ts","TanStack\u002Fdb:packages\u002Fbrowser-db-sqlite-persistence\u002Fsrc\u002Findex.ts","TanStack\u002Fdb:packages\u002Freact-native-db-sqlite-persistence\u002Fsrc\u002Findex.ts","TanStack\u002Fdb:packages\u002Fexpo-db-sqlite-persistence\u002Fsrc\u002Findex.ts","TanStack\u002Fdb:packages\u002Felectron-db-sqlite-persistence\u002Fsrc\u002Findex.ts","TanStack\u002Fdb:packages\u002Fnode-db-sqlite-persistence\u002Fsrc\u002Findex.ts","TanStack\u002Fdb:examples\u002Freact\u002Foffline-transactions\u002Fsrc\u002Fdb\u002Fpersisted-todos.ts","TanStack\u002Fdb:examples\u002Freact-native\u002Fshopping-list\u002Fsrc\u002Fdb\u002Fcollections.ts",{"type":50,"children":51},"root",[52,60,67,72,79,323,336,342,347,977,990,996,1008,1445,1479,1485,1490,1581,1586,1805,1810,2129,2135,2146,2213,2218,2224,2326,2332,2344,2349,2446,2451,2566,2585,2591,2595,2649,2653,2766,2778,2784,2796,2802,2866,2871,2876,2881],{"type":53,"tag":54,"props":55,"children":56},"element","p",{},[57],{"type":58,"value":59},"text","This skill builds on db-core and db-core\u002Fcollection-setup. Read those first.",{"type":53,"tag":61,"props":62,"children":64},"h1",{"id":63},"sqlite-persistence",[65],{"type":58,"value":66},"SQLite Persistence",{"type":53,"tag":54,"props":68,"children":69},{},[70],{"type":58,"value":71},"TanStack DB persistence adds a durable SQLite-backed layer to any collection. Data survives page reloads, app restarts, and offline periods. The server remains authoritative for synced collections -- persistence provides a local cache that hydrates instantly.",{"type":53,"tag":73,"props":74,"children":76},"h2",{"id":75},"choosing-a-platform-package",[77],{"type":58,"value":78},"Choosing a Platform Package",{"type":53,"tag":80,"props":81,"children":82},"table",{},[83,107],{"type":53,"tag":84,"props":85,"children":86},"thead",{},[87],{"type":53,"tag":88,"props":89,"children":90},"tr",{},[91,97,102],{"type":53,"tag":92,"props":93,"children":94},"th",{},[95],{"type":58,"value":96},"Platform",{"type":53,"tag":92,"props":98,"children":99},{},[100],{"type":58,"value":101},"Package",{"type":53,"tag":92,"props":103,"children":104},{},[105],{"type":58,"value":106},"Create function",{"type":53,"tag":108,"props":109,"children":110},"tbody",{},[111,139,165,191,219,245,271,297],{"type":53,"tag":88,"props":112,"children":113},{},[114,120,130],{"type":53,"tag":115,"props":116,"children":117},"td",{},[118],{"type":58,"value":119},"Browser (OPFS)",{"type":53,"tag":115,"props":121,"children":122},{},[123],{"type":53,"tag":124,"props":125,"children":127},"code",{"className":126},[],[128],{"type":58,"value":129},"@tanstack\u002Fbrowser-db-sqlite-persistence",{"type":53,"tag":115,"props":131,"children":132},{},[133],{"type":53,"tag":124,"props":134,"children":136},{"className":135},[],[137],{"type":58,"value":138},"createBrowserWASQLitePersistence",{"type":53,"tag":88,"props":140,"children":141},{},[142,147,156],{"type":53,"tag":115,"props":143,"children":144},{},[145],{"type":58,"value":146},"React Native",{"type":53,"tag":115,"props":148,"children":149},{},[150],{"type":53,"tag":124,"props":151,"children":153},{"className":152},[],[154],{"type":58,"value":155},"@tanstack\u002Freact-native-db-sqlite-persistence",{"type":53,"tag":115,"props":157,"children":158},{},[159],{"type":53,"tag":124,"props":160,"children":162},{"className":161},[],[163],{"type":58,"value":164},"createReactNativeSQLitePersistence",{"type":53,"tag":88,"props":166,"children":167},{},[168,173,182],{"type":53,"tag":115,"props":169,"children":170},{},[171],{"type":58,"value":172},"Expo",{"type":53,"tag":115,"props":174,"children":175},{},[176],{"type":53,"tag":124,"props":177,"children":179},{"className":178},[],[180],{"type":58,"value":181},"@tanstack\u002Fexpo-db-sqlite-persistence",{"type":53,"tag":115,"props":183,"children":184},{},[185],{"type":53,"tag":124,"props":186,"children":188},{"className":187},[],[189],{"type":58,"value":190},"createExpoSQLitePersistence",{"type":53,"tag":88,"props":192,"children":193},{},[194,199,208],{"type":53,"tag":115,"props":195,"children":196},{},[197],{"type":58,"value":198},"Electron",{"type":53,"tag":115,"props":200,"children":201},{},[202],{"type":53,"tag":124,"props":203,"children":205},{"className":204},[],[206],{"type":58,"value":207},"@tanstack\u002Felectron-db-sqlite-persistence",{"type":53,"tag":115,"props":209,"children":210},{},[211,217],{"type":53,"tag":124,"props":212,"children":214},{"className":213},[],[215],{"type":58,"value":216},"createElectronSQLitePersistence",{"type":58,"value":218}," (renderer)",{"type":53,"tag":88,"props":220,"children":221},{},[222,227,236],{"type":53,"tag":115,"props":223,"children":224},{},[225],{"type":58,"value":226},"Node.js",{"type":53,"tag":115,"props":228,"children":229},{},[230],{"type":53,"tag":124,"props":231,"children":233},{"className":232},[],[234],{"type":58,"value":235},"@tanstack\u002Fnode-db-sqlite-persistence",{"type":53,"tag":115,"props":237,"children":238},{},[239],{"type":53,"tag":124,"props":240,"children":242},{"className":241},[],[243],{"type":58,"value":244},"createNodeSQLitePersistence",{"type":53,"tag":88,"props":246,"children":247},{},[248,253,262],{"type":53,"tag":115,"props":249,"children":250},{},[251],{"type":58,"value":252},"Capacitor",{"type":53,"tag":115,"props":254,"children":255},{},[256],{"type":53,"tag":124,"props":257,"children":259},{"className":258},[],[260],{"type":58,"value":261},"@tanstack\u002Fcapacitor-db-sqlite-persistence",{"type":53,"tag":115,"props":263,"children":264},{},[265],{"type":53,"tag":124,"props":266,"children":268},{"className":267},[],[269],{"type":58,"value":270},"createCapacitorSQLitePersistence",{"type":53,"tag":88,"props":272,"children":273},{},[274,279,288],{"type":53,"tag":115,"props":275,"children":276},{},[277],{"type":58,"value":278},"Tauri",{"type":53,"tag":115,"props":280,"children":281},{},[282],{"type":53,"tag":124,"props":283,"children":285},{"className":284},[],[286],{"type":58,"value":287},"@tanstack\u002Ftauri-db-sqlite-persistence",{"type":53,"tag":115,"props":289,"children":290},{},[291],{"type":53,"tag":124,"props":292,"children":294},{"className":293},[],[295],{"type":58,"value":296},"createTauriSQLitePersistence",{"type":53,"tag":88,"props":298,"children":299},{},[300,305,314],{"type":53,"tag":115,"props":301,"children":302},{},[303],{"type":58,"value":304},"Cloudflare DO",{"type":53,"tag":115,"props":306,"children":307},{},[308],{"type":53,"tag":124,"props":309,"children":311},{"className":310},[],[312],{"type":58,"value":313},"@tanstack\u002Fcloudflare-durable-objects-db-sqlite-persistence",{"type":53,"tag":115,"props":315,"children":316},{},[317],{"type":53,"tag":124,"props":318,"children":320},{"className":319},[],[321],{"type":58,"value":322},"createCloudflareDOSQLitePersistence",{"type":53,"tag":54,"props":324,"children":325},{},[326,328,334],{"type":58,"value":327},"All platform packages re-export ",{"type":53,"tag":124,"props":329,"children":331},{"className":330},[],[332],{"type":58,"value":333},"persistedCollectionOptions",{"type":58,"value":335}," from the core.",{"type":53,"tag":73,"props":337,"children":339},{"id":338},"local-only-persistence-no-server",[340],{"type":58,"value":341},"Local-Only Persistence (No Server)",{"type":53,"tag":54,"props":343,"children":344},{},[345],{"type":58,"value":346},"For purely local data with no sync backend:",{"type":53,"tag":348,"props":349,"children":354},"pre",{"className":350,"code":351,"language":352,"meta":353,"style":353},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createCollection } from '@tanstack\u002Freact-db'\nimport {\n  BrowserCollectionCoordinator,\n  createBrowserWASQLitePersistence,\n  openBrowserWASQLiteOPFSDatabase,\n  persistedCollectionOptions,\n} from '@tanstack\u002Fbrowser-db-sqlite-persistence'\n\nconst database = await openBrowserWASQLiteOPFSDatabase({\n  databaseName: 'my-app.sqlite',\n})\n\nconst coordinator = new BrowserCollectionCoordinator({\n  dbName: 'my-app',\n})\n\nconst persistence = createBrowserWASQLitePersistence({\n  database,\n  coordinator,\n})\n\nconst draftsCollection = createCollection(\n  persistedCollectionOptions\u003CDraft, string>({\n    id: 'drafts',\n    getKey: (d) => d.id,\n    persistence,\n    schemaVersion: 1,\n  }),\n)\n","ts","",[355],{"type":53,"tag":124,"props":356,"children":357},{"__ignoreMap":353},[358,408,421,435,448,461,474,499,509,550,583,596,604,639,669,681,689,719,732,745,757,765,791,833,863,916,929,952,969],{"type":53,"tag":359,"props":360,"children":363},"span",{"class":361,"line":362},"line",1,[364,370,376,382,387,392,397,403],{"type":53,"tag":359,"props":365,"children":367},{"style":366},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[368],{"type":58,"value":369},"import",{"type":53,"tag":359,"props":371,"children":373},{"style":372},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[374],{"type":58,"value":375}," {",{"type":53,"tag":359,"props":377,"children":379},{"style":378},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[380],{"type":58,"value":381}," createCollection",{"type":53,"tag":359,"props":383,"children":384},{"style":372},[385],{"type":58,"value":386}," }",{"type":53,"tag":359,"props":388,"children":389},{"style":366},[390],{"type":58,"value":391}," from",{"type":53,"tag":359,"props":393,"children":394},{"style":372},[395],{"type":58,"value":396}," '",{"type":53,"tag":359,"props":398,"children":400},{"style":399},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[401],{"type":58,"value":402},"@tanstack\u002Freact-db",{"type":53,"tag":359,"props":404,"children":405},{"style":372},[406],{"type":58,"value":407},"'\n",{"type":53,"tag":359,"props":409,"children":411},{"class":361,"line":410},2,[412,416],{"type":53,"tag":359,"props":413,"children":414},{"style":366},[415],{"type":58,"value":369},{"type":53,"tag":359,"props":417,"children":418},{"style":372},[419],{"type":58,"value":420}," {\n",{"type":53,"tag":359,"props":422,"children":424},{"class":361,"line":423},3,[425,430],{"type":53,"tag":359,"props":426,"children":427},{"style":378},[428],{"type":58,"value":429},"  BrowserCollectionCoordinator",{"type":53,"tag":359,"props":431,"children":432},{"style":372},[433],{"type":58,"value":434},",\n",{"type":53,"tag":359,"props":436,"children":438},{"class":361,"line":437},4,[439,444],{"type":53,"tag":359,"props":440,"children":441},{"style":378},[442],{"type":58,"value":443},"  createBrowserWASQLitePersistence",{"type":53,"tag":359,"props":445,"children":446},{"style":372},[447],{"type":58,"value":434},{"type":53,"tag":359,"props":449,"children":451},{"class":361,"line":450},5,[452,457],{"type":53,"tag":359,"props":453,"children":454},{"style":378},[455],{"type":58,"value":456},"  openBrowserWASQLiteOPFSDatabase",{"type":53,"tag":359,"props":458,"children":459},{"style":372},[460],{"type":58,"value":434},{"type":53,"tag":359,"props":462,"children":464},{"class":361,"line":463},6,[465,470],{"type":53,"tag":359,"props":466,"children":467},{"style":378},[468],{"type":58,"value":469},"  persistedCollectionOptions",{"type":53,"tag":359,"props":471,"children":472},{"style":372},[473],{"type":58,"value":434},{"type":53,"tag":359,"props":475,"children":477},{"class":361,"line":476},7,[478,483,487,491,495],{"type":53,"tag":359,"props":479,"children":480},{"style":372},[481],{"type":58,"value":482},"}",{"type":53,"tag":359,"props":484,"children":485},{"style":366},[486],{"type":58,"value":391},{"type":53,"tag":359,"props":488,"children":489},{"style":372},[490],{"type":58,"value":396},{"type":53,"tag":359,"props":492,"children":493},{"style":399},[494],{"type":58,"value":129},{"type":53,"tag":359,"props":496,"children":497},{"style":372},[498],{"type":58,"value":407},{"type":53,"tag":359,"props":500,"children":502},{"class":361,"line":501},8,[503],{"type":53,"tag":359,"props":504,"children":506},{"emptyLinePlaceholder":505},true,[507],{"type":58,"value":508},"\n",{"type":53,"tag":359,"props":510,"children":512},{"class":361,"line":511},9,[513,519,524,529,534,540,545],{"type":53,"tag":359,"props":514,"children":516},{"style":515},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[517],{"type":58,"value":518},"const",{"type":53,"tag":359,"props":520,"children":521},{"style":378},[522],{"type":58,"value":523}," database ",{"type":53,"tag":359,"props":525,"children":526},{"style":372},[527],{"type":58,"value":528},"=",{"type":53,"tag":359,"props":530,"children":531},{"style":366},[532],{"type":58,"value":533}," await",{"type":53,"tag":359,"props":535,"children":537},{"style":536},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[538],{"type":58,"value":539}," openBrowserWASQLiteOPFSDatabase",{"type":53,"tag":359,"props":541,"children":542},{"style":378},[543],{"type":58,"value":544},"(",{"type":53,"tag":359,"props":546,"children":547},{"style":372},[548],{"type":58,"value":549},"{\n",{"type":53,"tag":359,"props":551,"children":553},{"class":361,"line":552},10,[554,560,565,569,574,579],{"type":53,"tag":359,"props":555,"children":557},{"style":556},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[558],{"type":58,"value":559},"  databaseName",{"type":53,"tag":359,"props":561,"children":562},{"style":372},[563],{"type":58,"value":564},":",{"type":53,"tag":359,"props":566,"children":567},{"style":372},[568],{"type":58,"value":396},{"type":53,"tag":359,"props":570,"children":571},{"style":399},[572],{"type":58,"value":573},"my-app.sqlite",{"type":53,"tag":359,"props":575,"children":576},{"style":372},[577],{"type":58,"value":578},"'",{"type":53,"tag":359,"props":580,"children":581},{"style":372},[582],{"type":58,"value":434},{"type":53,"tag":359,"props":584,"children":586},{"class":361,"line":585},11,[587,591],{"type":53,"tag":359,"props":588,"children":589},{"style":372},[590],{"type":58,"value":482},{"type":53,"tag":359,"props":592,"children":593},{"style":378},[594],{"type":58,"value":595},")\n",{"type":53,"tag":359,"props":597,"children":599},{"class":361,"line":598},12,[600],{"type":53,"tag":359,"props":601,"children":602},{"emptyLinePlaceholder":505},[603],{"type":58,"value":508},{"type":53,"tag":359,"props":605,"children":607},{"class":361,"line":606},13,[608,612,617,621,626,631,635],{"type":53,"tag":359,"props":609,"children":610},{"style":515},[611],{"type":58,"value":518},{"type":53,"tag":359,"props":613,"children":614},{"style":378},[615],{"type":58,"value":616}," coordinator ",{"type":53,"tag":359,"props":618,"children":619},{"style":372},[620],{"type":58,"value":528},{"type":53,"tag":359,"props":622,"children":623},{"style":372},[624],{"type":58,"value":625}," new",{"type":53,"tag":359,"props":627,"children":628},{"style":536},[629],{"type":58,"value":630}," BrowserCollectionCoordinator",{"type":53,"tag":359,"props":632,"children":633},{"style":378},[634],{"type":58,"value":544},{"type":53,"tag":359,"props":636,"children":637},{"style":372},[638],{"type":58,"value":549},{"type":53,"tag":359,"props":640,"children":642},{"class":361,"line":641},14,[643,648,652,656,661,665],{"type":53,"tag":359,"props":644,"children":645},{"style":556},[646],{"type":58,"value":647},"  dbName",{"type":53,"tag":359,"props":649,"children":650},{"style":372},[651],{"type":58,"value":564},{"type":53,"tag":359,"props":653,"children":654},{"style":372},[655],{"type":58,"value":396},{"type":53,"tag":359,"props":657,"children":658},{"style":399},[659],{"type":58,"value":660},"my-app",{"type":53,"tag":359,"props":662,"children":663},{"style":372},[664],{"type":58,"value":578},{"type":53,"tag":359,"props":666,"children":667},{"style":372},[668],{"type":58,"value":434},{"type":53,"tag":359,"props":670,"children":672},{"class":361,"line":671},15,[673,677],{"type":53,"tag":359,"props":674,"children":675},{"style":372},[676],{"type":58,"value":482},{"type":53,"tag":359,"props":678,"children":679},{"style":378},[680],{"type":58,"value":595},{"type":53,"tag":359,"props":682,"children":684},{"class":361,"line":683},16,[685],{"type":53,"tag":359,"props":686,"children":687},{"emptyLinePlaceholder":505},[688],{"type":58,"value":508},{"type":53,"tag":359,"props":690,"children":692},{"class":361,"line":691},17,[693,697,702,706,711,715],{"type":53,"tag":359,"props":694,"children":695},{"style":515},[696],{"type":58,"value":518},{"type":53,"tag":359,"props":698,"children":699},{"style":378},[700],{"type":58,"value":701}," persistence ",{"type":53,"tag":359,"props":703,"children":704},{"style":372},[705],{"type":58,"value":528},{"type":53,"tag":359,"props":707,"children":708},{"style":536},[709],{"type":58,"value":710}," createBrowserWASQLitePersistence",{"type":53,"tag":359,"props":712,"children":713},{"style":378},[714],{"type":58,"value":544},{"type":53,"tag":359,"props":716,"children":717},{"style":372},[718],{"type":58,"value":549},{"type":53,"tag":359,"props":720,"children":722},{"class":361,"line":721},18,[723,728],{"type":53,"tag":359,"props":724,"children":725},{"style":378},[726],{"type":58,"value":727},"  database",{"type":53,"tag":359,"props":729,"children":730},{"style":372},[731],{"type":58,"value":434},{"type":53,"tag":359,"props":733,"children":735},{"class":361,"line":734},19,[736,741],{"type":53,"tag":359,"props":737,"children":738},{"style":378},[739],{"type":58,"value":740},"  coordinator",{"type":53,"tag":359,"props":742,"children":743},{"style":372},[744],{"type":58,"value":434},{"type":53,"tag":359,"props":746,"children":748},{"class":361,"line":747},20,[749,753],{"type":53,"tag":359,"props":750,"children":751},{"style":372},[752],{"type":58,"value":482},{"type":53,"tag":359,"props":754,"children":755},{"style":378},[756],{"type":58,"value":595},{"type":53,"tag":359,"props":758,"children":760},{"class":361,"line":759},21,[761],{"type":53,"tag":359,"props":762,"children":763},{"emptyLinePlaceholder":505},[764],{"type":58,"value":508},{"type":53,"tag":359,"props":766,"children":768},{"class":361,"line":767},22,[769,773,778,782,786],{"type":53,"tag":359,"props":770,"children":771},{"style":515},[772],{"type":58,"value":518},{"type":53,"tag":359,"props":774,"children":775},{"style":378},[776],{"type":58,"value":777}," draftsCollection ",{"type":53,"tag":359,"props":779,"children":780},{"style":372},[781],{"type":58,"value":528},{"type":53,"tag":359,"props":783,"children":784},{"style":536},[785],{"type":58,"value":381},{"type":53,"tag":359,"props":787,"children":788},{"style":378},[789],{"type":58,"value":790},"(\n",{"type":53,"tag":359,"props":792,"children":794},{"class":361,"line":793},23,[795,799,804,810,815,820,825,829],{"type":53,"tag":359,"props":796,"children":797},{"style":536},[798],{"type":58,"value":469},{"type":53,"tag":359,"props":800,"children":801},{"style":372},[802],{"type":58,"value":803},"\u003C",{"type":53,"tag":359,"props":805,"children":807},{"style":806},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[808],{"type":58,"value":809},"Draft",{"type":53,"tag":359,"props":811,"children":812},{"style":372},[813],{"type":58,"value":814},",",{"type":53,"tag":359,"props":816,"children":817},{"style":806},[818],{"type":58,"value":819}," string",{"type":53,"tag":359,"props":821,"children":822},{"style":372},[823],{"type":58,"value":824},">",{"type":53,"tag":359,"props":826,"children":827},{"style":378},[828],{"type":58,"value":544},{"type":53,"tag":359,"props":830,"children":831},{"style":372},[832],{"type":58,"value":549},{"type":53,"tag":359,"props":834,"children":836},{"class":361,"line":835},24,[837,842,846,850,855,859],{"type":53,"tag":359,"props":838,"children":839},{"style":556},[840],{"type":58,"value":841},"    id",{"type":53,"tag":359,"props":843,"children":844},{"style":372},[845],{"type":58,"value":564},{"type":53,"tag":359,"props":847,"children":848},{"style":372},[849],{"type":58,"value":396},{"type":53,"tag":359,"props":851,"children":852},{"style":399},[853],{"type":58,"value":854},"drafts",{"type":53,"tag":359,"props":856,"children":857},{"style":372},[858],{"type":58,"value":578},{"type":53,"tag":359,"props":860,"children":861},{"style":372},[862],{"type":58,"value":434},{"type":53,"tag":359,"props":864,"children":866},{"class":361,"line":865},25,[867,872,876,881,887,892,897,902,907,912],{"type":53,"tag":359,"props":868,"children":869},{"style":536},[870],{"type":58,"value":871},"    getKey",{"type":53,"tag":359,"props":873,"children":874},{"style":372},[875],{"type":58,"value":564},{"type":53,"tag":359,"props":877,"children":878},{"style":372},[879],{"type":58,"value":880}," (",{"type":53,"tag":359,"props":882,"children":884},{"style":883},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[885],{"type":58,"value":886},"d",{"type":53,"tag":359,"props":888,"children":889},{"style":372},[890],{"type":58,"value":891},")",{"type":53,"tag":359,"props":893,"children":894},{"style":515},[895],{"type":58,"value":896}," =>",{"type":53,"tag":359,"props":898,"children":899},{"style":378},[900],{"type":58,"value":901}," d",{"type":53,"tag":359,"props":903,"children":904},{"style":372},[905],{"type":58,"value":906},".",{"type":53,"tag":359,"props":908,"children":909},{"style":378},[910],{"type":58,"value":911},"id",{"type":53,"tag":359,"props":913,"children":914},{"style":372},[915],{"type":58,"value":434},{"type":53,"tag":359,"props":917,"children":919},{"class":361,"line":918},26,[920,925],{"type":53,"tag":359,"props":921,"children":922},{"style":378},[923],{"type":58,"value":924},"    persistence",{"type":53,"tag":359,"props":926,"children":927},{"style":372},[928],{"type":58,"value":434},{"type":53,"tag":359,"props":930,"children":932},{"class":361,"line":931},27,[933,938,942,948],{"type":53,"tag":359,"props":934,"children":935},{"style":556},[936],{"type":58,"value":937},"    schemaVersion",{"type":53,"tag":359,"props":939,"children":940},{"style":372},[941],{"type":58,"value":564},{"type":53,"tag":359,"props":943,"children":945},{"style":944},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[946],{"type":58,"value":947}," 1",{"type":53,"tag":359,"props":949,"children":950},{"style":372},[951],{"type":58,"value":434},{"type":53,"tag":359,"props":953,"children":955},{"class":361,"line":954},28,[956,961,965],{"type":53,"tag":359,"props":957,"children":958},{"style":372},[959],{"type":58,"value":960},"  }",{"type":53,"tag":359,"props":962,"children":963},{"style":378},[964],{"type":58,"value":891},{"type":53,"tag":359,"props":966,"children":967},{"style":372},[968],{"type":58,"value":434},{"type":53,"tag":359,"props":970,"children":972},{"class":361,"line":971},29,[973],{"type":53,"tag":359,"props":974,"children":975},{"style":378},[976],{"type":58,"value":595},{"type":53,"tag":54,"props":978,"children":979},{},[980,982,988],{"type":58,"value":981},"Local-only collections provide ",{"type":53,"tag":124,"props":983,"children":985},{"className":984},[],[986],{"type":58,"value":987},"collection.utils.acceptMutations()",{"type":58,"value":989}," for applying mutations directly.",{"type":53,"tag":73,"props":991,"children":993},{"id":992},"synced-persistence-wrapping-an-adapter",[994],{"type":58,"value":995},"Synced Persistence (Wrapping an Adapter)",{"type":53,"tag":54,"props":997,"children":998},{},[999,1001,1006],{"type":58,"value":1000},"Spread an existing adapter's options into ",{"type":53,"tag":124,"props":1002,"children":1004},{"className":1003},[],[1005],{"type":58,"value":333},{"type":58,"value":1007}," to add persistence on top of sync:",{"type":53,"tag":348,"props":1009,"children":1011},{"className":350,"code":1010,"language":352,"meta":353,"style":353},"import { createCollection } from '@tanstack\u002Freact-db'\nimport { electricCollectionOptions } from '@tanstack\u002Felectric-db-collection'\nimport {\n  createReactNativeSQLitePersistence,\n  persistedCollectionOptions,\n} from '@tanstack\u002Freact-native-db-sqlite-persistence'\n\nconst persistence = createReactNativeSQLitePersistence({ database })\n\nconst todosCollection = createCollection(\n  persistedCollectionOptions({\n    ...electricCollectionOptions({\n      id: 'todos',\n      shapeOptions: { url: '\u002Fapi\u002Felectric\u002Ftodos' },\n      getKey: (item) => item.id,\n    }),\n    persistence,\n    schemaVersion: 1,\n  }),\n)\n",[1012],{"type":53,"tag":124,"props":1013,"children":1014},{"__ignoreMap":353},[1015,1050,1087,1098,1110,1121,1144,1151,1192,1199,1223,1238,1259,1288,1331,1377,1393,1404,1423,1438],{"type":53,"tag":359,"props":1016,"children":1017},{"class":361,"line":362},[1018,1022,1026,1030,1034,1038,1042,1046],{"type":53,"tag":359,"props":1019,"children":1020},{"style":366},[1021],{"type":58,"value":369},{"type":53,"tag":359,"props":1023,"children":1024},{"style":372},[1025],{"type":58,"value":375},{"type":53,"tag":359,"props":1027,"children":1028},{"style":378},[1029],{"type":58,"value":381},{"type":53,"tag":359,"props":1031,"children":1032},{"style":372},[1033],{"type":58,"value":386},{"type":53,"tag":359,"props":1035,"children":1036},{"style":366},[1037],{"type":58,"value":391},{"type":53,"tag":359,"props":1039,"children":1040},{"style":372},[1041],{"type":58,"value":396},{"type":53,"tag":359,"props":1043,"children":1044},{"style":399},[1045],{"type":58,"value":402},{"type":53,"tag":359,"props":1047,"children":1048},{"style":372},[1049],{"type":58,"value":407},{"type":53,"tag":359,"props":1051,"children":1052},{"class":361,"line":410},[1053,1057,1061,1066,1070,1074,1078,1083],{"type":53,"tag":359,"props":1054,"children":1055},{"style":366},[1056],{"type":58,"value":369},{"type":53,"tag":359,"props":1058,"children":1059},{"style":372},[1060],{"type":58,"value":375},{"type":53,"tag":359,"props":1062,"children":1063},{"style":378},[1064],{"type":58,"value":1065}," electricCollectionOptions",{"type":53,"tag":359,"props":1067,"children":1068},{"style":372},[1069],{"type":58,"value":386},{"type":53,"tag":359,"props":1071,"children":1072},{"style":366},[1073],{"type":58,"value":391},{"type":53,"tag":359,"props":1075,"children":1076},{"style":372},[1077],{"type":58,"value":396},{"type":53,"tag":359,"props":1079,"children":1080},{"style":399},[1081],{"type":58,"value":1082},"@tanstack\u002Felectric-db-collection",{"type":53,"tag":359,"props":1084,"children":1085},{"style":372},[1086],{"type":58,"value":407},{"type":53,"tag":359,"props":1088,"children":1089},{"class":361,"line":423},[1090,1094],{"type":53,"tag":359,"props":1091,"children":1092},{"style":366},[1093],{"type":58,"value":369},{"type":53,"tag":359,"props":1095,"children":1096},{"style":372},[1097],{"type":58,"value":420},{"type":53,"tag":359,"props":1099,"children":1100},{"class":361,"line":437},[1101,1106],{"type":53,"tag":359,"props":1102,"children":1103},{"style":378},[1104],{"type":58,"value":1105},"  createReactNativeSQLitePersistence",{"type":53,"tag":359,"props":1107,"children":1108},{"style":372},[1109],{"type":58,"value":434},{"type":53,"tag":359,"props":1111,"children":1112},{"class":361,"line":450},[1113,1117],{"type":53,"tag":359,"props":1114,"children":1115},{"style":378},[1116],{"type":58,"value":469},{"type":53,"tag":359,"props":1118,"children":1119},{"style":372},[1120],{"type":58,"value":434},{"type":53,"tag":359,"props":1122,"children":1123},{"class":361,"line":463},[1124,1128,1132,1136,1140],{"type":53,"tag":359,"props":1125,"children":1126},{"style":372},[1127],{"type":58,"value":482},{"type":53,"tag":359,"props":1129,"children":1130},{"style":366},[1131],{"type":58,"value":391},{"type":53,"tag":359,"props":1133,"children":1134},{"style":372},[1135],{"type":58,"value":396},{"type":53,"tag":359,"props":1137,"children":1138},{"style":399},[1139],{"type":58,"value":155},{"type":53,"tag":359,"props":1141,"children":1142},{"style":372},[1143],{"type":58,"value":407},{"type":53,"tag":359,"props":1145,"children":1146},{"class":361,"line":476},[1147],{"type":53,"tag":359,"props":1148,"children":1149},{"emptyLinePlaceholder":505},[1150],{"type":58,"value":508},{"type":53,"tag":359,"props":1152,"children":1153},{"class":361,"line":501},[1154,1158,1162,1166,1171,1175,1180,1184,1188],{"type":53,"tag":359,"props":1155,"children":1156},{"style":515},[1157],{"type":58,"value":518},{"type":53,"tag":359,"props":1159,"children":1160},{"style":378},[1161],{"type":58,"value":701},{"type":53,"tag":359,"props":1163,"children":1164},{"style":372},[1165],{"type":58,"value":528},{"type":53,"tag":359,"props":1167,"children":1168},{"style":536},[1169],{"type":58,"value":1170}," createReactNativeSQLitePersistence",{"type":53,"tag":359,"props":1172,"children":1173},{"style":378},[1174],{"type":58,"value":544},{"type":53,"tag":359,"props":1176,"children":1177},{"style":372},[1178],{"type":58,"value":1179},"{",{"type":53,"tag":359,"props":1181,"children":1182},{"style":378},[1183],{"type":58,"value":523},{"type":53,"tag":359,"props":1185,"children":1186},{"style":372},[1187],{"type":58,"value":482},{"type":53,"tag":359,"props":1189,"children":1190},{"style":378},[1191],{"type":58,"value":595},{"type":53,"tag":359,"props":1193,"children":1194},{"class":361,"line":511},[1195],{"type":53,"tag":359,"props":1196,"children":1197},{"emptyLinePlaceholder":505},[1198],{"type":58,"value":508},{"type":53,"tag":359,"props":1200,"children":1201},{"class":361,"line":552},[1202,1206,1211,1215,1219],{"type":53,"tag":359,"props":1203,"children":1204},{"style":515},[1205],{"type":58,"value":518},{"type":53,"tag":359,"props":1207,"children":1208},{"style":378},[1209],{"type":58,"value":1210}," todosCollection ",{"type":53,"tag":359,"props":1212,"children":1213},{"style":372},[1214],{"type":58,"value":528},{"type":53,"tag":359,"props":1216,"children":1217},{"style":536},[1218],{"type":58,"value":381},{"type":53,"tag":359,"props":1220,"children":1221},{"style":378},[1222],{"type":58,"value":790},{"type":53,"tag":359,"props":1224,"children":1225},{"class":361,"line":585},[1226,1230,1234],{"type":53,"tag":359,"props":1227,"children":1228},{"style":536},[1229],{"type":58,"value":469},{"type":53,"tag":359,"props":1231,"children":1232},{"style":378},[1233],{"type":58,"value":544},{"type":53,"tag":359,"props":1235,"children":1236},{"style":372},[1237],{"type":58,"value":549},{"type":53,"tag":359,"props":1239,"children":1240},{"class":361,"line":598},[1241,1246,1251,1255],{"type":53,"tag":359,"props":1242,"children":1243},{"style":372},[1244],{"type":58,"value":1245},"    ...",{"type":53,"tag":359,"props":1247,"children":1248},{"style":536},[1249],{"type":58,"value":1250},"electricCollectionOptions",{"type":53,"tag":359,"props":1252,"children":1253},{"style":378},[1254],{"type":58,"value":544},{"type":53,"tag":359,"props":1256,"children":1257},{"style":372},[1258],{"type":58,"value":549},{"type":53,"tag":359,"props":1260,"children":1261},{"class":361,"line":606},[1262,1267,1271,1275,1280,1284],{"type":53,"tag":359,"props":1263,"children":1264},{"style":556},[1265],{"type":58,"value":1266},"      id",{"type":53,"tag":359,"props":1268,"children":1269},{"style":372},[1270],{"type":58,"value":564},{"type":53,"tag":359,"props":1272,"children":1273},{"style":372},[1274],{"type":58,"value":396},{"type":53,"tag":359,"props":1276,"children":1277},{"style":399},[1278],{"type":58,"value":1279},"todos",{"type":53,"tag":359,"props":1281,"children":1282},{"style":372},[1283],{"type":58,"value":578},{"type":53,"tag":359,"props":1285,"children":1286},{"style":372},[1287],{"type":58,"value":434},{"type":53,"tag":359,"props":1289,"children":1290},{"class":361,"line":641},[1291,1296,1300,1304,1309,1313,1317,1322,1326],{"type":53,"tag":359,"props":1292,"children":1293},{"style":556},[1294],{"type":58,"value":1295},"      shapeOptions",{"type":53,"tag":359,"props":1297,"children":1298},{"style":372},[1299],{"type":58,"value":564},{"type":53,"tag":359,"props":1301,"children":1302},{"style":372},[1303],{"type":58,"value":375},{"type":53,"tag":359,"props":1305,"children":1306},{"style":556},[1307],{"type":58,"value":1308}," url",{"type":53,"tag":359,"props":1310,"children":1311},{"style":372},[1312],{"type":58,"value":564},{"type":53,"tag":359,"props":1314,"children":1315},{"style":372},[1316],{"type":58,"value":396},{"type":53,"tag":359,"props":1318,"children":1319},{"style":399},[1320],{"type":58,"value":1321},"\u002Fapi\u002Felectric\u002Ftodos",{"type":53,"tag":359,"props":1323,"children":1324},{"style":372},[1325],{"type":58,"value":578},{"type":53,"tag":359,"props":1327,"children":1328},{"style":372},[1329],{"type":58,"value":1330}," },\n",{"type":53,"tag":359,"props":1332,"children":1333},{"class":361,"line":671},[1334,1339,1343,1347,1352,1356,1360,1365,1369,1373],{"type":53,"tag":359,"props":1335,"children":1336},{"style":536},[1337],{"type":58,"value":1338},"      getKey",{"type":53,"tag":359,"props":1340,"children":1341},{"style":372},[1342],{"type":58,"value":564},{"type":53,"tag":359,"props":1344,"children":1345},{"style":372},[1346],{"type":58,"value":880},{"type":53,"tag":359,"props":1348,"children":1349},{"style":883},[1350],{"type":58,"value":1351},"item",{"type":53,"tag":359,"props":1353,"children":1354},{"style":372},[1355],{"type":58,"value":891},{"type":53,"tag":359,"props":1357,"children":1358},{"style":515},[1359],{"type":58,"value":896},{"type":53,"tag":359,"props":1361,"children":1362},{"style":378},[1363],{"type":58,"value":1364}," item",{"type":53,"tag":359,"props":1366,"children":1367},{"style":372},[1368],{"type":58,"value":906},{"type":53,"tag":359,"props":1370,"children":1371},{"style":378},[1372],{"type":58,"value":911},{"type":53,"tag":359,"props":1374,"children":1375},{"style":372},[1376],{"type":58,"value":434},{"type":53,"tag":359,"props":1378,"children":1379},{"class":361,"line":683},[1380,1385,1389],{"type":53,"tag":359,"props":1381,"children":1382},{"style":372},[1383],{"type":58,"value":1384},"    }",{"type":53,"tag":359,"props":1386,"children":1387},{"style":378},[1388],{"type":58,"value":891},{"type":53,"tag":359,"props":1390,"children":1391},{"style":372},[1392],{"type":58,"value":434},{"type":53,"tag":359,"props":1394,"children":1395},{"class":361,"line":691},[1396,1400],{"type":53,"tag":359,"props":1397,"children":1398},{"style":378},[1399],{"type":58,"value":924},{"type":53,"tag":359,"props":1401,"children":1402},{"style":372},[1403],{"type":58,"value":434},{"type":53,"tag":359,"props":1405,"children":1406},{"class":361,"line":721},[1407,1411,1415,1419],{"type":53,"tag":359,"props":1408,"children":1409},{"style":556},[1410],{"type":58,"value":937},{"type":53,"tag":359,"props":1412,"children":1413},{"style":372},[1414],{"type":58,"value":564},{"type":53,"tag":359,"props":1416,"children":1417},{"style":944},[1418],{"type":58,"value":947},{"type":53,"tag":359,"props":1420,"children":1421},{"style":372},[1422],{"type":58,"value":434},{"type":53,"tag":359,"props":1424,"children":1425},{"class":361,"line":734},[1426,1430,1434],{"type":53,"tag":359,"props":1427,"children":1428},{"style":372},[1429],{"type":58,"value":960},{"type":53,"tag":359,"props":1431,"children":1432},{"style":378},[1433],{"type":58,"value":891},{"type":53,"tag":359,"props":1435,"children":1436},{"style":372},[1437],{"type":58,"value":434},{"type":53,"tag":359,"props":1439,"children":1440},{"class":361,"line":747},[1441],{"type":53,"tag":359,"props":1442,"children":1443},{"style":378},[1444],{"type":58,"value":595},{"type":53,"tag":54,"props":1446,"children":1447},{},[1448,1450,1455,1457,1463,1464,1470,1472,1477],{"type":58,"value":1449},"This works with any adapter: ",{"type":53,"tag":124,"props":1451,"children":1453},{"className":1452},[],[1454],{"type":58,"value":1250},{"type":58,"value":1456},", ",{"type":53,"tag":124,"props":1458,"children":1460},{"className":1459},[],[1461],{"type":58,"value":1462},"queryCollectionOptions",{"type":58,"value":1456},{"type":53,"tag":124,"props":1465,"children":1467},{"className":1466},[],[1468],{"type":58,"value":1469},"powerSyncCollectionOptions",{"type":58,"value":1471},", etc. The ",{"type":53,"tag":124,"props":1473,"children":1475},{"className":1474},[],[1476],{"type":58,"value":333},{"type":58,"value":1478}," wrapper intercepts the sync layer to persist data as it flows through.",{"type":53,"tag":73,"props":1480,"children":1482},{"id":1481},"multi-tab-multi-process-coordination",[1483],{"type":58,"value":1484},"Multi-Tab \u002F Multi-Process Coordination",{"type":53,"tag":54,"props":1486,"children":1487},{},[1488],{"type":58,"value":1489},"Coordinators handle leader election and cross-instance communication so only one tab\u002Fprocess owns the database writer.",{"type":53,"tag":80,"props":1491,"children":1492},{},[1493,1513],{"type":53,"tag":84,"props":1494,"children":1495},{},[1496],{"type":53,"tag":88,"props":1497,"children":1498},{},[1499,1503,1508],{"type":53,"tag":92,"props":1500,"children":1501},{},[1502],{"type":58,"value":96},{"type":53,"tag":92,"props":1504,"children":1505},{},[1506],{"type":58,"value":1507},"Coordinator",{"type":53,"tag":92,"props":1509,"children":1510},{},[1511],{"type":58,"value":1512},"Mechanism",{"type":53,"tag":108,"props":1514,"children":1515},{},[1516,1538,1559],{"type":53,"tag":88,"props":1517,"children":1518},{},[1519,1524,1533],{"type":53,"tag":115,"props":1520,"children":1521},{},[1522],{"type":58,"value":1523},"Browser",{"type":53,"tag":115,"props":1525,"children":1526},{},[1527],{"type":53,"tag":124,"props":1528,"children":1530},{"className":1529},[],[1531],{"type":58,"value":1532},"BrowserCollectionCoordinator",{"type":53,"tag":115,"props":1534,"children":1535},{},[1536],{"type":58,"value":1537},"BroadcastChannel + Web Locks",{"type":53,"tag":88,"props":1539,"children":1540},{},[1541,1545,1554],{"type":53,"tag":115,"props":1542,"children":1543},{},[1544],{"type":58,"value":198},{"type":53,"tag":115,"props":1546,"children":1547},{},[1548],{"type":53,"tag":124,"props":1549,"children":1551},{"className":1550},[],[1552],{"type":58,"value":1553},"ElectronCollectionCoordinator",{"type":53,"tag":115,"props":1555,"children":1556},{},[1557],{"type":58,"value":1558},"IPC (main holds DB, renderer accesses via RPC)",{"type":53,"tag":88,"props":1560,"children":1561},{},[1562,1567,1576],{"type":53,"tag":115,"props":1563,"children":1564},{},[1565],{"type":58,"value":1566},"Single-process (RN, Expo, Node, etc.)",{"type":53,"tag":115,"props":1568,"children":1569},{},[1570],{"type":53,"tag":124,"props":1571,"children":1573},{"className":1572},[],[1574],{"type":58,"value":1575},"SingleProcessCoordinator",{"type":53,"tag":115,"props":1577,"children":1578},{},[1579],{"type":58,"value":1580},"No-op (always leader)",{"type":53,"tag":54,"props":1582,"children":1583},{},[1584],{"type":58,"value":1585},"Browser example:",{"type":53,"tag":348,"props":1587,"children":1589},{"className":350,"code":1588,"language":352,"meta":353,"style":353},"import { BrowserCollectionCoordinator } from '@tanstack\u002Fbrowser-db-sqlite-persistence'\n\nconst coordinator = new BrowserCollectionCoordinator({\n  dbName: 'my-app',\n})\n\n\u002F\u002F Pass to persistence\nconst persistence = createBrowserWASQLitePersistence({ database, coordinator })\n\n\u002F\u002F Cleanup on shutdown\ncoordinator.dispose()\n",[1590],{"type":53,"tag":124,"props":1591,"children":1592},{"__ignoreMap":353},[1593,1628,1635,1666,1693,1704,1711,1720,1768,1775,1783],{"type":53,"tag":359,"props":1594,"children":1595},{"class":361,"line":362},[1596,1600,1604,1608,1612,1616,1620,1624],{"type":53,"tag":359,"props":1597,"children":1598},{"style":366},[1599],{"type":58,"value":369},{"type":53,"tag":359,"props":1601,"children":1602},{"style":372},[1603],{"type":58,"value":375},{"type":53,"tag":359,"props":1605,"children":1606},{"style":378},[1607],{"type":58,"value":630},{"type":53,"tag":359,"props":1609,"children":1610},{"style":372},[1611],{"type":58,"value":386},{"type":53,"tag":359,"props":1613,"children":1614},{"style":366},[1615],{"type":58,"value":391},{"type":53,"tag":359,"props":1617,"children":1618},{"style":372},[1619],{"type":58,"value":396},{"type":53,"tag":359,"props":1621,"children":1622},{"style":399},[1623],{"type":58,"value":129},{"type":53,"tag":359,"props":1625,"children":1626},{"style":372},[1627],{"type":58,"value":407},{"type":53,"tag":359,"props":1629,"children":1630},{"class":361,"line":410},[1631],{"type":53,"tag":359,"props":1632,"children":1633},{"emptyLinePlaceholder":505},[1634],{"type":58,"value":508},{"type":53,"tag":359,"props":1636,"children":1637},{"class":361,"line":423},[1638,1642,1646,1650,1654,1658,1662],{"type":53,"tag":359,"props":1639,"children":1640},{"style":515},[1641],{"type":58,"value":518},{"type":53,"tag":359,"props":1643,"children":1644},{"style":378},[1645],{"type":58,"value":616},{"type":53,"tag":359,"props":1647,"children":1648},{"style":372},[1649],{"type":58,"value":528},{"type":53,"tag":359,"props":1651,"children":1652},{"style":372},[1653],{"type":58,"value":625},{"type":53,"tag":359,"props":1655,"children":1656},{"style":536},[1657],{"type":58,"value":630},{"type":53,"tag":359,"props":1659,"children":1660},{"style":378},[1661],{"type":58,"value":544},{"type":53,"tag":359,"props":1663,"children":1664},{"style":372},[1665],{"type":58,"value":549},{"type":53,"tag":359,"props":1667,"children":1668},{"class":361,"line":437},[1669,1673,1677,1681,1685,1689],{"type":53,"tag":359,"props":1670,"children":1671},{"style":556},[1672],{"type":58,"value":647},{"type":53,"tag":359,"props":1674,"children":1675},{"style":372},[1676],{"type":58,"value":564},{"type":53,"tag":359,"props":1678,"children":1679},{"style":372},[1680],{"type":58,"value":396},{"type":53,"tag":359,"props":1682,"children":1683},{"style":399},[1684],{"type":58,"value":660},{"type":53,"tag":359,"props":1686,"children":1687},{"style":372},[1688],{"type":58,"value":578},{"type":53,"tag":359,"props":1690,"children":1691},{"style":372},[1692],{"type":58,"value":434},{"type":53,"tag":359,"props":1694,"children":1695},{"class":361,"line":450},[1696,1700],{"type":53,"tag":359,"props":1697,"children":1698},{"style":372},[1699],{"type":58,"value":482},{"type":53,"tag":359,"props":1701,"children":1702},{"style":378},[1703],{"type":58,"value":595},{"type":53,"tag":359,"props":1705,"children":1706},{"class":361,"line":463},[1707],{"type":53,"tag":359,"props":1708,"children":1709},{"emptyLinePlaceholder":505},[1710],{"type":58,"value":508},{"type":53,"tag":359,"props":1712,"children":1713},{"class":361,"line":476},[1714],{"type":53,"tag":359,"props":1715,"children":1717},{"style":1716},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[1718],{"type":58,"value":1719},"\u002F\u002F Pass to persistence\n",{"type":53,"tag":359,"props":1721,"children":1722},{"class":361,"line":501},[1723,1727,1731,1735,1739,1743,1747,1752,1756,1760,1764],{"type":53,"tag":359,"props":1724,"children":1725},{"style":515},[1726],{"type":58,"value":518},{"type":53,"tag":359,"props":1728,"children":1729},{"style":378},[1730],{"type":58,"value":701},{"type":53,"tag":359,"props":1732,"children":1733},{"style":372},[1734],{"type":58,"value":528},{"type":53,"tag":359,"props":1736,"children":1737},{"style":536},[1738],{"type":58,"value":710},{"type":53,"tag":359,"props":1740,"children":1741},{"style":378},[1742],{"type":58,"value":544},{"type":53,"tag":359,"props":1744,"children":1745},{"style":372},[1746],{"type":58,"value":1179},{"type":53,"tag":359,"props":1748,"children":1749},{"style":378},[1750],{"type":58,"value":1751}," database",{"type":53,"tag":359,"props":1753,"children":1754},{"style":372},[1755],{"type":58,"value":814},{"type":53,"tag":359,"props":1757,"children":1758},{"style":378},[1759],{"type":58,"value":616},{"type":53,"tag":359,"props":1761,"children":1762},{"style":372},[1763],{"type":58,"value":482},{"type":53,"tag":359,"props":1765,"children":1766},{"style":378},[1767],{"type":58,"value":595},{"type":53,"tag":359,"props":1769,"children":1770},{"class":361,"line":511},[1771],{"type":53,"tag":359,"props":1772,"children":1773},{"emptyLinePlaceholder":505},[1774],{"type":58,"value":508},{"type":53,"tag":359,"props":1776,"children":1777},{"class":361,"line":552},[1778],{"type":53,"tag":359,"props":1779,"children":1780},{"style":1716},[1781],{"type":58,"value":1782},"\u002F\u002F Cleanup on shutdown\n",{"type":53,"tag":359,"props":1784,"children":1785},{"class":361,"line":585},[1786,1791,1795,1800],{"type":53,"tag":359,"props":1787,"children":1788},{"style":378},[1789],{"type":58,"value":1790},"coordinator",{"type":53,"tag":359,"props":1792,"children":1793},{"style":372},[1794],{"type":58,"value":906},{"type":53,"tag":359,"props":1796,"children":1797},{"style":536},[1798],{"type":58,"value":1799},"dispose",{"type":53,"tag":359,"props":1801,"children":1802},{"style":378},[1803],{"type":58,"value":1804},"()\n",{"type":53,"tag":54,"props":1806,"children":1807},{},[1808],{"type":58,"value":1809},"Electron requires setup in both processes:",{"type":53,"tag":348,"props":1811,"children":1813},{"className":350,"code":1812,"language":352,"meta":353,"style":353},"\u002F\u002F Main process\nimport { exposeElectronSQLitePersistence } from '@tanstack\u002Felectron-db-sqlite-persistence'\nexposeElectronSQLitePersistence({ persistence, ipcMain })\n\n\u002F\u002F Renderer process\nimport {\n  createElectronSQLitePersistence,\n  ElectronCollectionCoordinator,\n} from '@tanstack\u002Felectron-db-sqlite-persistence'\n\nconst coordinator = new ElectronCollectionCoordinator({ dbName: 'my-app' })\nconst persistence = createElectronSQLitePersistence({\n  ipcRenderer: window.electron.ipcRenderer,\n  coordinator,\n})\n",[1814],{"type":53,"tag":124,"props":1815,"children":1816},{"__ignoreMap":353},[1817,1825,1861,1899,1906,1914,1925,1937,1949,1972,1979,2040,2068,2107,2118],{"type":53,"tag":359,"props":1818,"children":1819},{"class":361,"line":362},[1820],{"type":53,"tag":359,"props":1821,"children":1822},{"style":1716},[1823],{"type":58,"value":1824},"\u002F\u002F Main process\n",{"type":53,"tag":359,"props":1826,"children":1827},{"class":361,"line":410},[1828,1832,1836,1841,1845,1849,1853,1857],{"type":53,"tag":359,"props":1829,"children":1830},{"style":366},[1831],{"type":58,"value":369},{"type":53,"tag":359,"props":1833,"children":1834},{"style":372},[1835],{"type":58,"value":375},{"type":53,"tag":359,"props":1837,"children":1838},{"style":378},[1839],{"type":58,"value":1840}," exposeElectronSQLitePersistence",{"type":53,"tag":359,"props":1842,"children":1843},{"style":372},[1844],{"type":58,"value":386},{"type":53,"tag":359,"props":1846,"children":1847},{"style":366},[1848],{"type":58,"value":391},{"type":53,"tag":359,"props":1850,"children":1851},{"style":372},[1852],{"type":58,"value":396},{"type":53,"tag":359,"props":1854,"children":1855},{"style":399},[1856],{"type":58,"value":207},{"type":53,"tag":359,"props":1858,"children":1859},{"style":372},[1860],{"type":58,"value":407},{"type":53,"tag":359,"props":1862,"children":1863},{"class":361,"line":423},[1864,1869,1873,1877,1882,1886,1891,1895],{"type":53,"tag":359,"props":1865,"children":1866},{"style":536},[1867],{"type":58,"value":1868},"exposeElectronSQLitePersistence",{"type":53,"tag":359,"props":1870,"children":1871},{"style":378},[1872],{"type":58,"value":544},{"type":53,"tag":359,"props":1874,"children":1875},{"style":372},[1876],{"type":58,"value":1179},{"type":53,"tag":359,"props":1878,"children":1879},{"style":378},[1880],{"type":58,"value":1881}," persistence",{"type":53,"tag":359,"props":1883,"children":1884},{"style":372},[1885],{"type":58,"value":814},{"type":53,"tag":359,"props":1887,"children":1888},{"style":378},[1889],{"type":58,"value":1890}," ipcMain ",{"type":53,"tag":359,"props":1892,"children":1893},{"style":372},[1894],{"type":58,"value":482},{"type":53,"tag":359,"props":1896,"children":1897},{"style":378},[1898],{"type":58,"value":595},{"type":53,"tag":359,"props":1900,"children":1901},{"class":361,"line":437},[1902],{"type":53,"tag":359,"props":1903,"children":1904},{"emptyLinePlaceholder":505},[1905],{"type":58,"value":508},{"type":53,"tag":359,"props":1907,"children":1908},{"class":361,"line":450},[1909],{"type":53,"tag":359,"props":1910,"children":1911},{"style":1716},[1912],{"type":58,"value":1913},"\u002F\u002F Renderer process\n",{"type":53,"tag":359,"props":1915,"children":1916},{"class":361,"line":463},[1917,1921],{"type":53,"tag":359,"props":1918,"children":1919},{"style":366},[1920],{"type":58,"value":369},{"type":53,"tag":359,"props":1922,"children":1923},{"style":372},[1924],{"type":58,"value":420},{"type":53,"tag":359,"props":1926,"children":1927},{"class":361,"line":476},[1928,1933],{"type":53,"tag":359,"props":1929,"children":1930},{"style":378},[1931],{"type":58,"value":1932},"  createElectronSQLitePersistence",{"type":53,"tag":359,"props":1934,"children":1935},{"style":372},[1936],{"type":58,"value":434},{"type":53,"tag":359,"props":1938,"children":1939},{"class":361,"line":501},[1940,1945],{"type":53,"tag":359,"props":1941,"children":1942},{"style":378},[1943],{"type":58,"value":1944},"  ElectronCollectionCoordinator",{"type":53,"tag":359,"props":1946,"children":1947},{"style":372},[1948],{"type":58,"value":434},{"type":53,"tag":359,"props":1950,"children":1951},{"class":361,"line":511},[1952,1956,1960,1964,1968],{"type":53,"tag":359,"props":1953,"children":1954},{"style":372},[1955],{"type":58,"value":482},{"type":53,"tag":359,"props":1957,"children":1958},{"style":366},[1959],{"type":58,"value":391},{"type":53,"tag":359,"props":1961,"children":1962},{"style":372},[1963],{"type":58,"value":396},{"type":53,"tag":359,"props":1965,"children":1966},{"style":399},[1967],{"type":58,"value":207},{"type":53,"tag":359,"props":1969,"children":1970},{"style":372},[1971],{"type":58,"value":407},{"type":53,"tag":359,"props":1973,"children":1974},{"class":361,"line":552},[1975],{"type":53,"tag":359,"props":1976,"children":1977},{"emptyLinePlaceholder":505},[1978],{"type":58,"value":508},{"type":53,"tag":359,"props":1980,"children":1981},{"class":361,"line":585},[1982,1986,1990,1994,1998,2003,2007,2011,2016,2020,2024,2028,2032,2036],{"type":53,"tag":359,"props":1983,"children":1984},{"style":515},[1985],{"type":58,"value":518},{"type":53,"tag":359,"props":1987,"children":1988},{"style":378},[1989],{"type":58,"value":616},{"type":53,"tag":359,"props":1991,"children":1992},{"style":372},[1993],{"type":58,"value":528},{"type":53,"tag":359,"props":1995,"children":1996},{"style":372},[1997],{"type":58,"value":625},{"type":53,"tag":359,"props":1999,"children":2000},{"style":536},[2001],{"type":58,"value":2002}," ElectronCollectionCoordinator",{"type":53,"tag":359,"props":2004,"children":2005},{"style":378},[2006],{"type":58,"value":544},{"type":53,"tag":359,"props":2008,"children":2009},{"style":372},[2010],{"type":58,"value":1179},{"type":53,"tag":359,"props":2012,"children":2013},{"style":556},[2014],{"type":58,"value":2015}," dbName",{"type":53,"tag":359,"props":2017,"children":2018},{"style":372},[2019],{"type":58,"value":564},{"type":53,"tag":359,"props":2021,"children":2022},{"style":372},[2023],{"type":58,"value":396},{"type":53,"tag":359,"props":2025,"children":2026},{"style":399},[2027],{"type":58,"value":660},{"type":53,"tag":359,"props":2029,"children":2030},{"style":372},[2031],{"type":58,"value":578},{"type":53,"tag":359,"props":2033,"children":2034},{"style":372},[2035],{"type":58,"value":386},{"type":53,"tag":359,"props":2037,"children":2038},{"style":378},[2039],{"type":58,"value":595},{"type":53,"tag":359,"props":2041,"children":2042},{"class":361,"line":598},[2043,2047,2051,2055,2060,2064],{"type":53,"tag":359,"props":2044,"children":2045},{"style":515},[2046],{"type":58,"value":518},{"type":53,"tag":359,"props":2048,"children":2049},{"style":378},[2050],{"type":58,"value":701},{"type":53,"tag":359,"props":2052,"children":2053},{"style":372},[2054],{"type":58,"value":528},{"type":53,"tag":359,"props":2056,"children":2057},{"style":536},[2058],{"type":58,"value":2059}," createElectronSQLitePersistence",{"type":53,"tag":359,"props":2061,"children":2062},{"style":378},[2063],{"type":58,"value":544},{"type":53,"tag":359,"props":2065,"children":2066},{"style":372},[2067],{"type":58,"value":549},{"type":53,"tag":359,"props":2069,"children":2070},{"class":361,"line":606},[2071,2076,2080,2085,2089,2094,2098,2103],{"type":53,"tag":359,"props":2072,"children":2073},{"style":556},[2074],{"type":58,"value":2075},"  ipcRenderer",{"type":53,"tag":359,"props":2077,"children":2078},{"style":372},[2079],{"type":58,"value":564},{"type":53,"tag":359,"props":2081,"children":2082},{"style":378},[2083],{"type":58,"value":2084}," window",{"type":53,"tag":359,"props":2086,"children":2087},{"style":372},[2088],{"type":58,"value":906},{"type":53,"tag":359,"props":2090,"children":2091},{"style":378},[2092],{"type":58,"value":2093},"electron",{"type":53,"tag":359,"props":2095,"children":2096},{"style":372},[2097],{"type":58,"value":906},{"type":53,"tag":359,"props":2099,"children":2100},{"style":378},[2101],{"type":58,"value":2102},"ipcRenderer",{"type":53,"tag":359,"props":2104,"children":2105},{"style":372},[2106],{"type":58,"value":434},{"type":53,"tag":359,"props":2108,"children":2109},{"class":361,"line":641},[2110,2114],{"type":53,"tag":359,"props":2111,"children":2112},{"style":378},[2113],{"type":58,"value":740},{"type":53,"tag":359,"props":2115,"children":2116},{"style":372},[2117],{"type":58,"value":434},{"type":53,"tag":359,"props":2119,"children":2120},{"class":361,"line":671},[2121,2125],{"type":53,"tag":359,"props":2122,"children":2123},{"style":372},[2124],{"type":58,"value":482},{"type":53,"tag":359,"props":2126,"children":2127},{"style":378},[2128],{"type":58,"value":595},{"type":53,"tag":73,"props":2130,"children":2132},{"id":2131},"schema-versioning",[2133],{"type":58,"value":2134},"Schema Versioning",{"type":53,"tag":54,"props":2136,"children":2137},{},[2138,2144],{"type":53,"tag":124,"props":2139,"children":2141},{"className":2140},[],[2142],{"type":58,"value":2143},"schemaVersion",{"type":58,"value":2145}," tracks the shape of persisted data. When the stored version doesn't match the code, the collection resets (drops and reloads from server for synced collections, or throws for local-only).",{"type":53,"tag":348,"props":2147,"children":2149},{"className":350,"code":2148,"language":352,"meta":353,"style":353},"persistedCollectionOptions({\n  \u002F\u002F ...\n  schemaVersion: 2, \u002F\u002F bump when you change the data shape\n})\n",[2150],{"type":53,"tag":124,"props":2151,"children":2152},{"__ignoreMap":353},[2153,2168,2176,2202],{"type":53,"tag":359,"props":2154,"children":2155},{"class":361,"line":362},[2156,2160,2164],{"type":53,"tag":359,"props":2157,"children":2158},{"style":536},[2159],{"type":58,"value":333},{"type":53,"tag":359,"props":2161,"children":2162},{"style":378},[2163],{"type":58,"value":544},{"type":53,"tag":359,"props":2165,"children":2166},{"style":372},[2167],{"type":58,"value":549},{"type":53,"tag":359,"props":2169,"children":2170},{"class":361,"line":410},[2171],{"type":53,"tag":359,"props":2172,"children":2173},{"style":1716},[2174],{"type":58,"value":2175},"  \u002F\u002F ...\n",{"type":53,"tag":359,"props":2177,"children":2178},{"class":361,"line":423},[2179,2184,2188,2193,2197],{"type":53,"tag":359,"props":2180,"children":2181},{"style":556},[2182],{"type":58,"value":2183},"  schemaVersion",{"type":53,"tag":359,"props":2185,"children":2186},{"style":372},[2187],{"type":58,"value":564},{"type":53,"tag":359,"props":2189,"children":2190},{"style":944},[2191],{"type":58,"value":2192}," 2",{"type":53,"tag":359,"props":2194,"children":2195},{"style":372},[2196],{"type":58,"value":814},{"type":53,"tag":359,"props":2198,"children":2199},{"style":1716},[2200],{"type":58,"value":2201}," \u002F\u002F bump when you change the data shape\n",{"type":53,"tag":359,"props":2203,"children":2204},{"class":361,"line":437},[2205,2209],{"type":53,"tag":359,"props":2206,"children":2207},{"style":372},[2208],{"type":58,"value":482},{"type":53,"tag":359,"props":2210,"children":2211},{"style":378},[2212],{"type":58,"value":595},{"type":53,"tag":54,"props":2214,"children":2215},{},[2216],{"type":58,"value":2217},"There is no custom migration function -- a version mismatch triggers a full reset. For synced collections this is safe because the server re-supplies the data.",{"type":53,"tag":73,"props":2219,"children":2221},{"id":2220},"key-options",[2222],{"type":58,"value":2223},"Key Options",{"type":53,"tag":80,"props":2225,"children":2226},{},[2227,2248],{"type":53,"tag":84,"props":2228,"children":2229},{},[2230],{"type":53,"tag":88,"props":2231,"children":2232},{},[2233,2238,2243],{"type":53,"tag":92,"props":2234,"children":2235},{},[2236],{"type":58,"value":2237},"Option",{"type":53,"tag":92,"props":2239,"children":2240},{},[2241],{"type":58,"value":2242},"Type",{"type":53,"tag":92,"props":2244,"children":2245},{},[2246],{"type":58,"value":2247},"Description",{"type":53,"tag":108,"props":2249,"children":2250},{},[2251,2276,2301],{"type":53,"tag":88,"props":2252,"children":2253},{},[2254,2262,2271],{"type":53,"tag":115,"props":2255,"children":2256},{},[2257],{"type":53,"tag":124,"props":2258,"children":2260},{"className":2259},[],[2261],{"type":58,"value":19},{"type":53,"tag":115,"props":2263,"children":2264},{},[2265],{"type":53,"tag":124,"props":2266,"children":2268},{"className":2267},[],[2269],{"type":58,"value":2270},"PersistedCollectionPersistence",{"type":53,"tag":115,"props":2272,"children":2273},{},[2274],{"type":58,"value":2275},"Platform adapter + coordinator",{"type":53,"tag":88,"props":2277,"children":2278},{},[2279,2287,2296],{"type":53,"tag":115,"props":2280,"children":2281},{},[2282],{"type":53,"tag":124,"props":2283,"children":2285},{"className":2284},[],[2286],{"type":58,"value":2143},{"type":53,"tag":115,"props":2288,"children":2289},{},[2290],{"type":53,"tag":124,"props":2291,"children":2293},{"className":2292},[],[2294],{"type":58,"value":2295},"number",{"type":53,"tag":115,"props":2297,"children":2298},{},[2299],{"type":58,"value":2300},"Data version (default 1). Bump on schema changes",{"type":53,"tag":88,"props":2302,"children":2303},{},[2304,2312,2321],{"type":53,"tag":115,"props":2305,"children":2306},{},[2307],{"type":53,"tag":124,"props":2308,"children":2310},{"className":2309},[],[2311],{"type":58,"value":911},{"type":53,"tag":115,"props":2313,"children":2314},{},[2315],{"type":53,"tag":124,"props":2316,"children":2318},{"className":2317},[],[2319],{"type":58,"value":2320},"string",{"type":53,"tag":115,"props":2322,"children":2323},{},[2324],{"type":58,"value":2325},"Required for local-only. Collection identifier in SQLite",{"type":53,"tag":73,"props":2327,"children":2329},{"id":2328},"common-mistakes",[2330],{"type":58,"value":2331},"Common Mistakes",{"type":53,"tag":2333,"props":2334,"children":2336},"h3",{"id":2335},"critical-using-local-only-persistence-without-an-id",[2337,2339],{"type":58,"value":2338},"CRITICAL Using local-only persistence without an ",{"type":53,"tag":124,"props":2340,"children":2342},{"className":2341},[],[2343],{"type":58,"value":911},{"type":53,"tag":54,"props":2345,"children":2346},{},[2347],{"type":58,"value":2348},"Wrong:",{"type":53,"tag":348,"props":2350,"children":2352},{"className":350,"code":2351,"language":352,"meta":353,"style":353},"persistedCollectionOptions({\n  getKey: (d) => d.id,\n  persistence,\n  \u002F\u002F missing id — generates random UUID each session, data won't persist across reloads\n})\n",[2353],{"type":53,"tag":124,"props":2354,"children":2355},{"__ignoreMap":353},[2356,2371,2415,2427,2435],{"type":53,"tag":359,"props":2357,"children":2358},{"class":361,"line":362},[2359,2363,2367],{"type":53,"tag":359,"props":2360,"children":2361},{"style":536},[2362],{"type":58,"value":333},{"type":53,"tag":359,"props":2364,"children":2365},{"style":378},[2366],{"type":58,"value":544},{"type":53,"tag":359,"props":2368,"children":2369},{"style":372},[2370],{"type":58,"value":549},{"type":53,"tag":359,"props":2372,"children":2373},{"class":361,"line":410},[2374,2379,2383,2387,2391,2395,2399,2403,2407,2411],{"type":53,"tag":359,"props":2375,"children":2376},{"style":536},[2377],{"type":58,"value":2378},"  getKey",{"type":53,"tag":359,"props":2380,"children":2381},{"style":372},[2382],{"type":58,"value":564},{"type":53,"tag":359,"props":2384,"children":2385},{"style":372},[2386],{"type":58,"value":880},{"type":53,"tag":359,"props":2388,"children":2389},{"style":883},[2390],{"type":58,"value":886},{"type":53,"tag":359,"props":2392,"children":2393},{"style":372},[2394],{"type":58,"value":891},{"type":53,"tag":359,"props":2396,"children":2397},{"style":515},[2398],{"type":58,"value":896},{"type":53,"tag":359,"props":2400,"children":2401},{"style":378},[2402],{"type":58,"value":901},{"type":53,"tag":359,"props":2404,"children":2405},{"style":372},[2406],{"type":58,"value":906},{"type":53,"tag":359,"props":2408,"children":2409},{"style":378},[2410],{"type":58,"value":911},{"type":53,"tag":359,"props":2412,"children":2413},{"style":372},[2414],{"type":58,"value":434},{"type":53,"tag":359,"props":2416,"children":2417},{"class":361,"line":423},[2418,2423],{"type":53,"tag":359,"props":2419,"children":2420},{"style":378},[2421],{"type":58,"value":2422},"  persistence",{"type":53,"tag":359,"props":2424,"children":2425},{"style":372},[2426],{"type":58,"value":434},{"type":53,"tag":359,"props":2428,"children":2429},{"class":361,"line":437},[2430],{"type":53,"tag":359,"props":2431,"children":2432},{"style":1716},[2433],{"type":58,"value":2434},"  \u002F\u002F missing id — generates random UUID each session, data won't persist across reloads\n",{"type":53,"tag":359,"props":2436,"children":2437},{"class":361,"line":450},[2438,2442],{"type":53,"tag":359,"props":2439,"children":2440},{"style":372},[2441],{"type":58,"value":482},{"type":53,"tag":359,"props":2443,"children":2444},{"style":378},[2445],{"type":58,"value":595},{"type":53,"tag":54,"props":2447,"children":2448},{},[2449],{"type":58,"value":2450},"Correct:",{"type":53,"tag":348,"props":2452,"children":2454},{"className":350,"code":2453,"language":352,"meta":353,"style":353},"persistedCollectionOptions({\n  id: 'drafts',\n  getKey: (d) => d.id,\n  persistence,\n})\n",[2455],{"type":53,"tag":124,"props":2456,"children":2457},{"__ignoreMap":353},[2458,2473,2501,2544,2555],{"type":53,"tag":359,"props":2459,"children":2460},{"class":361,"line":362},[2461,2465,2469],{"type":53,"tag":359,"props":2462,"children":2463},{"style":536},[2464],{"type":58,"value":333},{"type":53,"tag":359,"props":2466,"children":2467},{"style":378},[2468],{"type":58,"value":544},{"type":53,"tag":359,"props":2470,"children":2471},{"style":372},[2472],{"type":58,"value":549},{"type":53,"tag":359,"props":2474,"children":2475},{"class":361,"line":410},[2476,2481,2485,2489,2493,2497],{"type":53,"tag":359,"props":2477,"children":2478},{"style":556},[2479],{"type":58,"value":2480},"  id",{"type":53,"tag":359,"props":2482,"children":2483},{"style":372},[2484],{"type":58,"value":564},{"type":53,"tag":359,"props":2486,"children":2487},{"style":372},[2488],{"type":58,"value":396},{"type":53,"tag":359,"props":2490,"children":2491},{"style":399},[2492],{"type":58,"value":854},{"type":53,"tag":359,"props":2494,"children":2495},{"style":372},[2496],{"type":58,"value":578},{"type":53,"tag":359,"props":2498,"children":2499},{"style":372},[2500],{"type":58,"value":434},{"type":53,"tag":359,"props":2502,"children":2503},{"class":361,"line":423},[2504,2508,2512,2516,2520,2524,2528,2532,2536,2540],{"type":53,"tag":359,"props":2505,"children":2506},{"style":536},[2507],{"type":58,"value":2378},{"type":53,"tag":359,"props":2509,"children":2510},{"style":372},[2511],{"type":58,"value":564},{"type":53,"tag":359,"props":2513,"children":2514},{"style":372},[2515],{"type":58,"value":880},{"type":53,"tag":359,"props":2517,"children":2518},{"style":883},[2519],{"type":58,"value":886},{"type":53,"tag":359,"props":2521,"children":2522},{"style":372},[2523],{"type":58,"value":891},{"type":53,"tag":359,"props":2525,"children":2526},{"style":515},[2527],{"type":58,"value":896},{"type":53,"tag":359,"props":2529,"children":2530},{"style":378},[2531],{"type":58,"value":901},{"type":53,"tag":359,"props":2533,"children":2534},{"style":372},[2535],{"type":58,"value":906},{"type":53,"tag":359,"props":2537,"children":2538},{"style":378},[2539],{"type":58,"value":911},{"type":53,"tag":359,"props":2541,"children":2542},{"style":372},[2543],{"type":58,"value":434},{"type":53,"tag":359,"props":2545,"children":2546},{"class":361,"line":437},[2547,2551],{"type":53,"tag":359,"props":2548,"children":2549},{"style":378},[2550],{"type":58,"value":2422},{"type":53,"tag":359,"props":2552,"children":2553},{"style":372},[2554],{"type":58,"value":434},{"type":53,"tag":359,"props":2556,"children":2557},{"class":361,"line":450},[2558,2562],{"type":53,"tag":359,"props":2559,"children":2560},{"style":372},[2561],{"type":58,"value":482},{"type":53,"tag":359,"props":2563,"children":2564},{"style":378},[2565],{"type":58,"value":595},{"type":53,"tag":54,"props":2567,"children":2568},{},[2569,2571,2576,2578,2583],{"type":58,"value":2570},"Without an explicit ",{"type":53,"tag":124,"props":2572,"children":2574},{"className":2573},[],[2575],{"type":58,"value":911},{"type":58,"value":2577},", the code generates a random UUID each session, so persisted data is silently abandoned on every reload. Local-only persisted collections must always provide an ",{"type":53,"tag":124,"props":2579,"children":2581},{"className":2580},[],[2582],{"type":58,"value":911},{"type":58,"value":2584},". Synced collections derive it from the adapter config.",{"type":53,"tag":2333,"props":2586,"children":2588},{"id":2587},"high-forgetting-the-coordinator-in-multi-tab-apps",[2589],{"type":58,"value":2590},"HIGH Forgetting the coordinator in multi-tab apps",{"type":53,"tag":54,"props":2592,"children":2593},{},[2594],{"type":58,"value":2348},{"type":53,"tag":348,"props":2596,"children":2598},{"className":350,"code":2597,"language":352,"meta":353,"style":353},"const persistence = createBrowserWASQLitePersistence({ database })\n\u002F\u002F No coordinator — concurrent tabs corrupt the database\n",[2599],{"type":53,"tag":124,"props":2600,"children":2601},{"__ignoreMap":353},[2602,2641],{"type":53,"tag":359,"props":2603,"children":2604},{"class":361,"line":362},[2605,2609,2613,2617,2621,2625,2629,2633,2637],{"type":53,"tag":359,"props":2606,"children":2607},{"style":515},[2608],{"type":58,"value":518},{"type":53,"tag":359,"props":2610,"children":2611},{"style":378},[2612],{"type":58,"value":701},{"type":53,"tag":359,"props":2614,"children":2615},{"style":372},[2616],{"type":58,"value":528},{"type":53,"tag":359,"props":2618,"children":2619},{"style":536},[2620],{"type":58,"value":710},{"type":53,"tag":359,"props":2622,"children":2623},{"style":378},[2624],{"type":58,"value":544},{"type":53,"tag":359,"props":2626,"children":2627},{"style":372},[2628],{"type":58,"value":1179},{"type":53,"tag":359,"props":2630,"children":2631},{"style":378},[2632],{"type":58,"value":523},{"type":53,"tag":359,"props":2634,"children":2635},{"style":372},[2636],{"type":58,"value":482},{"type":53,"tag":359,"props":2638,"children":2639},{"style":378},[2640],{"type":58,"value":595},{"type":53,"tag":359,"props":2642,"children":2643},{"class":361,"line":410},[2644],{"type":53,"tag":359,"props":2645,"children":2646},{"style":1716},[2647],{"type":58,"value":2648},"\u002F\u002F No coordinator — concurrent tabs corrupt the database\n",{"type":53,"tag":54,"props":2650,"children":2651},{},[2652],{"type":58,"value":2450},{"type":53,"tag":348,"props":2654,"children":2656},{"className":350,"code":2655,"language":352,"meta":353,"style":353},"const coordinator = new BrowserCollectionCoordinator({ dbName: 'my-app' })\nconst persistence = createBrowserWASQLitePersistence({ database, coordinator })\n",[2657],{"type":53,"tag":124,"props":2658,"children":2659},{"__ignoreMap":353},[2660,2719],{"type":53,"tag":359,"props":2661,"children":2662},{"class":361,"line":362},[2663,2667,2671,2675,2679,2683,2687,2691,2695,2699,2703,2707,2711,2715],{"type":53,"tag":359,"props":2664,"children":2665},{"style":515},[2666],{"type":58,"value":518},{"type":53,"tag":359,"props":2668,"children":2669},{"style":378},[2670],{"type":58,"value":616},{"type":53,"tag":359,"props":2672,"children":2673},{"style":372},[2674],{"type":58,"value":528},{"type":53,"tag":359,"props":2676,"children":2677},{"style":372},[2678],{"type":58,"value":625},{"type":53,"tag":359,"props":2680,"children":2681},{"style":536},[2682],{"type":58,"value":630},{"type":53,"tag":359,"props":2684,"children":2685},{"style":378},[2686],{"type":58,"value":544},{"type":53,"tag":359,"props":2688,"children":2689},{"style":372},[2690],{"type":58,"value":1179},{"type":53,"tag":359,"props":2692,"children":2693},{"style":556},[2694],{"type":58,"value":2015},{"type":53,"tag":359,"props":2696,"children":2697},{"style":372},[2698],{"type":58,"value":564},{"type":53,"tag":359,"props":2700,"children":2701},{"style":372},[2702],{"type":58,"value":396},{"type":53,"tag":359,"props":2704,"children":2705},{"style":399},[2706],{"type":58,"value":660},{"type":53,"tag":359,"props":2708,"children":2709},{"style":372},[2710],{"type":58,"value":578},{"type":53,"tag":359,"props":2712,"children":2713},{"style":372},[2714],{"type":58,"value":386},{"type":53,"tag":359,"props":2716,"children":2717},{"style":378},[2718],{"type":58,"value":595},{"type":53,"tag":359,"props":2720,"children":2721},{"class":361,"line":410},[2722,2726,2730,2734,2738,2742,2746,2750,2754,2758,2762],{"type":53,"tag":359,"props":2723,"children":2724},{"style":515},[2725],{"type":58,"value":518},{"type":53,"tag":359,"props":2727,"children":2728},{"style":378},[2729],{"type":58,"value":701},{"type":53,"tag":359,"props":2731,"children":2732},{"style":372},[2733],{"type":58,"value":528},{"type":53,"tag":359,"props":2735,"children":2736},{"style":536},[2737],{"type":58,"value":710},{"type":53,"tag":359,"props":2739,"children":2740},{"style":378},[2741],{"type":58,"value":544},{"type":53,"tag":359,"props":2743,"children":2744},{"style":372},[2745],{"type":58,"value":1179},{"type":53,"tag":359,"props":2747,"children":2748},{"style":378},[2749],{"type":58,"value":1751},{"type":53,"tag":359,"props":2751,"children":2752},{"style":372},[2753],{"type":58,"value":814},{"type":53,"tag":359,"props":2755,"children":2756},{"style":378},[2757],{"type":58,"value":616},{"type":53,"tag":359,"props":2759,"children":2760},{"style":372},[2761],{"type":58,"value":482},{"type":53,"tag":359,"props":2763,"children":2764},{"style":378},[2765],{"type":58,"value":595},{"type":53,"tag":54,"props":2767,"children":2768},{},[2769,2771,2776],{"type":58,"value":2770},"Without a coordinator, multiple browser tabs write to SQLite concurrently, causing data corruption. Always use ",{"type":53,"tag":124,"props":2772,"children":2774},{"className":2773},[],[2775],{"type":58,"value":1532},{"type":58,"value":2777}," in browser environments.",{"type":53,"tag":2333,"props":2779,"children":2781},{"id":2780},"high-not-bumping-schemaversion-after-changing-data-shape",[2782],{"type":58,"value":2783},"HIGH Not bumping schemaVersion after changing data shape",{"type":53,"tag":54,"props":2785,"children":2786},{},[2787,2789,2794],{"type":58,"value":2788},"If you add, remove, or rename fields in your collection type but keep the same ",{"type":53,"tag":124,"props":2790,"children":2792},{"className":2791},[],[2793],{"type":58,"value":2143},{"type":58,"value":2795},", the persisted SQLite data will have the old shape. For synced collections, bump the version to trigger a reset and re-sync.",{"type":53,"tag":2333,"props":2797,"children":2799},{"id":2798},"medium-not-disposing-the-coordinator-on-cleanup",[2800],{"type":58,"value":2801},"MEDIUM Not disposing the coordinator on cleanup",{"type":53,"tag":348,"props":2803,"children":2805},{"className":350,"code":2804,"language":352,"meta":353,"style":353},"\u002F\u002F On app shutdown or hot module reload\ncoordinator.dispose()\nawait database.close?.()\n",[2806],{"type":53,"tag":124,"props":2807,"children":2808},{"__ignoreMap":353},[2809,2817,2836],{"type":53,"tag":359,"props":2810,"children":2811},{"class":361,"line":362},[2812],{"type":53,"tag":359,"props":2813,"children":2814},{"style":1716},[2815],{"type":58,"value":2816},"\u002F\u002F On app shutdown or hot module reload\n",{"type":53,"tag":359,"props":2818,"children":2819},{"class":361,"line":410},[2820,2824,2828,2832],{"type":53,"tag":359,"props":2821,"children":2822},{"style":378},[2823],{"type":58,"value":1790},{"type":53,"tag":359,"props":2825,"children":2826},{"style":372},[2827],{"type":58,"value":906},{"type":53,"tag":359,"props":2829,"children":2830},{"style":536},[2831],{"type":58,"value":1799},{"type":53,"tag":359,"props":2833,"children":2834},{"style":378},[2835],{"type":58,"value":1804},{"type":53,"tag":359,"props":2837,"children":2838},{"class":361,"line":423},[2839,2844,2848,2852,2857,2862],{"type":53,"tag":359,"props":2840,"children":2841},{"style":366},[2842],{"type":58,"value":2843},"await",{"type":53,"tag":359,"props":2845,"children":2846},{"style":378},[2847],{"type":58,"value":1751},{"type":53,"tag":359,"props":2849,"children":2850},{"style":372},[2851],{"type":58,"value":906},{"type":53,"tag":359,"props":2853,"children":2854},{"style":536},[2855],{"type":58,"value":2856},"close",{"type":53,"tag":359,"props":2858,"children":2859},{"style":372},[2860],{"type":58,"value":2861},"?.",{"type":53,"tag":359,"props":2863,"children":2864},{"style":378},[2865],{"type":58,"value":1804},{"type":53,"tag":54,"props":2867,"children":2868},{},[2869],{"type":58,"value":2870},"Failing to dispose leaks BroadcastChannel subscriptions and Web Lock handles.",{"type":53,"tag":54,"props":2872,"children":2873},{},[2874],{"type":58,"value":2875},"See also: db-core\u002Fcollection-setup\u002FSKILL.md — for adapter selection and collection configuration.",{"type":53,"tag":54,"props":2877,"children":2878},{},[2879],{"type":58,"value":2880},"See also: offline\u002FSKILL.md — for offline transaction queueing (complements persistence).",{"type":53,"tag":2882,"props":2883,"children":2884},"style",{},[2885],{"type":58,"value":2886},"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":2888,"total":606},[2889,2903,2915,2926,2939,2952,2965],{"slug":2890,"name":2890,"fn":2891,"description":2892,"org":2893,"tags":2894,"stars":24,"repoUrl":25,"updatedAt":2902},"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},[2895,2898,2899],{"name":2896,"slug":2897,"type":16},"Angular","angular",{"name":14,"slug":15,"type":16},{"name":2900,"slug":2901,"type":16},"TypeScript","typescript","2026-07-16T06:01:16.345046",{"slug":2904,"name":2904,"fn":2905,"description":2906,"org":2907,"tags":2908,"stars":24,"repoUrl":25,"updatedAt":2914},"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},[2909,2912,2913],{"name":2910,"slug":2911,"type":16},"Data Modeling","data-modeling",{"name":14,"slug":15,"type":16},{"name":10,"slug":9,"type":16},"2026-07-17T06:06:40.214285",{"slug":2916,"name":2917,"fn":2918,"description":2919,"org":2920,"tags":2921,"stars":24,"repoUrl":25,"updatedAt":2925},"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},[2922,2923,2924],{"name":2910,"slug":2911,"type":16},{"name":14,"slug":15,"type":16},{"name":10,"slug":9,"type":16},"2026-07-26T05:48:58.321777",{"slug":2927,"name":2928,"fn":2929,"description":2930,"org":2931,"tags":2932,"stars":24,"repoUrl":25,"updatedAt":2938},"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},[2933,2934,2937],{"name":14,"slug":15,"type":16},{"name":2935,"slug":2936,"type":16},"Engineering","engineering",{"name":10,"slug":9,"type":16},"2026-07-16T06:04:06.862485",{"slug":2940,"name":2941,"fn":2942,"description":2943,"org":2944,"tags":2945,"stars":24,"repoUrl":25,"updatedAt":2951},"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},[2946,2947,2950],{"name":14,"slug":15,"type":16},{"name":2948,"slug":2949,"type":16},"SQL","sql",{"name":10,"slug":9,"type":16},"2026-07-16T06:04:08.757365",{"slug":2953,"name":2954,"fn":2955,"description":2956,"org":2957,"tags":2958,"stars":24,"repoUrl":25,"updatedAt":2964},"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},[2959,2960,2963],{"name":14,"slug":15,"type":16},{"name":2961,"slug":2962,"type":16},"Frontend","frontend",{"name":10,"slug":9,"type":16},"2026-07-26T05:48:57.301803",{"slug":4,"name":5,"fn":6,"description":7,"org":2966,"tags":2967,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[2968,2969,2970,2971],{"name":14,"slug":15,"type":16},{"name":18,"slug":19,"type":16},{"name":22,"slug":23,"type":16},{"name":10,"slug":9,"type":16},{"items":2973,"total":3113},[2974,2988,3000,3012,3027,3039,3049,3059,3072,3082,3093,3103],{"slug":2975,"name":2975,"fn":2976,"description":2977,"org":2978,"tags":2979,"stars":2985,"repoUrl":2986,"updatedAt":2987},"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},[2980,2983,2984],{"name":2981,"slug":2982,"type":16},"Data Analysis","data-analysis",{"name":2961,"slug":2962,"type":16},{"name":10,"slug":9,"type":16},28175,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Ftable","2026-07-30T05:25:59.429787",{"slug":2989,"name":2989,"fn":2990,"description":2991,"org":2992,"tags":2993,"stars":2985,"repoUrl":2986,"updatedAt":2999},"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},[2994,2997,2998],{"name":2995,"slug":2996,"type":16},"Debugging","debugging",{"name":2961,"slug":2962,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:05.418735",{"slug":3001,"name":3001,"fn":3002,"description":3003,"org":3004,"tags":3005,"stars":2985,"repoUrl":2986,"updatedAt":3011},"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},[3006,3007,3008],{"name":2981,"slug":2982,"type":16},{"name":10,"slug":9,"type":16},{"name":3009,"slug":3010,"type":16},"UI Components","ui-components","2026-07-30T05:25:38.403427",{"slug":3013,"name":3013,"fn":3014,"description":3015,"org":3016,"tags":3017,"stars":2985,"repoUrl":2986,"updatedAt":3026},"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},[3018,3021,3022,3025],{"name":3019,"slug":3020,"type":16},"Data Pipeline","data-pipeline",{"name":2961,"slug":2962,"type":16},{"name":3023,"slug":3024,"type":16},"Performance","performance",{"name":10,"slug":9,"type":16},"2026-07-30T05:25:45.400104",{"slug":3028,"name":3028,"fn":3029,"description":3030,"org":3031,"tags":3032,"stars":2985,"repoUrl":2986,"updatedAt":3038},"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},[3033,3036,3037],{"name":3034,"slug":3035,"type":16},"Data Visualization","data-visualization",{"name":2961,"slug":2962,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:41.397257",{"slug":3040,"name":3040,"fn":3041,"description":3042,"org":3043,"tags":3044,"stars":2985,"repoUrl":2986,"updatedAt":3048},"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},[3045,3046,3047],{"name":2981,"slug":2982,"type":16},{"name":2961,"slug":2962,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:53.391632",{"slug":3050,"name":3050,"fn":3051,"description":3052,"org":3053,"tags":3054,"stars":2985,"repoUrl":2986,"updatedAt":3058},"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},[3055,3056,3057],{"name":2961,"slug":2962,"type":16},{"name":10,"slug":9,"type":16},{"name":3009,"slug":3010,"type":16},"2026-07-30T05:26:03.37801",{"slug":3060,"name":3060,"fn":3061,"description":3062,"org":3063,"tags":3064,"stars":2985,"repoUrl":2986,"updatedAt":3071},"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},[3065,3068,3069,3070],{"name":3066,"slug":3067,"type":16},"CSS","css",{"name":2961,"slug":2962,"type":16},{"name":10,"slug":9,"type":16},{"name":3009,"slug":3010,"type":16},"2026-07-30T05:25:55.377366",{"slug":3073,"name":3073,"fn":3074,"description":3075,"org":3076,"tags":3077,"stars":2985,"repoUrl":2986,"updatedAt":3081},"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},[3078,3079,3080],{"name":2961,"slug":2962,"type":16},{"name":10,"slug":9,"type":16},{"name":3009,"slug":3010,"type":16},"2026-07-30T05:25:51.400011",{"slug":3083,"name":3083,"fn":3084,"description":3085,"org":3086,"tags":3087,"stars":2985,"repoUrl":2986,"updatedAt":3092},"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},[3088,3089,3090,3091],{"name":3066,"slug":3067,"type":16},{"name":2961,"slug":2962,"type":16},{"name":10,"slug":9,"type":16},{"name":3009,"slug":3010,"type":16},"2026-07-30T05:25:48.703799",{"slug":3094,"name":3094,"fn":3095,"description":3096,"org":3097,"tags":3098,"stars":2985,"repoUrl":2986,"updatedAt":3102},"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},[3099,3100,3101],{"name":2961,"slug":2962,"type":16},{"name":10,"slug":9,"type":16},{"name":3009,"slug":3010,"type":16},"2026-07-30T05:25:47.367943",{"slug":3104,"name":3104,"fn":3105,"description":3106,"org":3107,"tags":3108,"stars":2985,"repoUrl":2986,"updatedAt":3112},"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},[3109,3110,3111],{"name":2981,"slug":2982,"type":16},{"name":2961,"slug":2962,"type":16},{"name":3009,"slug":3010,"type":16},"2026-07-30T05:25:52.366295",125]