[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C580SCSJK0E5Z54AJTV242":3,"skill-same:01M6C580SCSJK0E5Z54AJTV242":204},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":15,"repositoryHtmlUrl":42,"repositoryHomepageUrl":43,"ownerHtmlUrl":44,"ownerBlogUrl":45,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M6C580SCSJK0E5Z54AJTV242","query-sync","Ditto DQL 查询与数据同步","Ditto SDK DQL reads and writes, subscriptions, and store observers (Flutter, JavaScript, Kotlin, Swift): query parameters, MISSING vs NULL, membership filters, subscription and observer lifecycle, ON ID CONFLICT upserts, JOIN, RETURNING. Use when writing or reviewing ditto.store.execute, ditto.sync.registerSubscription, registerObserver, or DQL in an app that uses Ditto, or when Ditto data does not sync or a Ditto query returns nothing.","Ditto SDK 的 DQL 读写、订阅和存储观察器（Flutter、JavaScript、Kotlin、Swift）：查询参数、MISSING 与 NULL 的区别、成员资格过滤器、订阅与观察器的生命周期、ON ID CONFLICT 更新插入（upsert）、JOIN、RETURNING。适用于在使用 Ditto 的应用中编写或审查 ditto.store.execute、ditto.sync.registerSubscription、registerObserver 或 DQL，或当 Ditto 数据无法同步、Ditto 查询返回空结果时。","ditto-examples\u002Fditto-cookbook","ditto-examples","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F192611150?v=4","01M6C57F0Y1W6S5D9RD8GHE3YB","Ditto Examples","01M6C57F52Z11DDMBC0ZJ7FJPG",0,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C7B262C3NBH17S93KFN7JG","数据集成与同步","SCENARIO","使用场景",[31,32,33],"sync","query sync","query","2026-11-10 10:12:30",false,"---\nname: query-sync\ndescription: \"Ditto SDK DQL reads and writes, subscriptions, and store observers (Flutter, JavaScript, Kotlin, Swift): query parameters, MISSING vs NULL, membership filters, subscription and observer lifecycle, ON ID CONFLICT upserts, JOIN, RETURNING. Use when writing or reviewing ditto.store.execute, ditto.sync.registerSubscription, registerObserver, or DQL in an app that uses Ditto, or when Ditto data does not sync or a Ditto query returns nothing.\"\n---\n\n# Ditto Query and Sync Patterns\n\nDQL statements, subscriptions, and store observers: what syncs, what a query sees, and cheap observers and upserts. Targets Ditto SDK 5.2.0 in every SDK.\n\n## Before You Apply\n\n- Identify the project's SDK and version: Flutter (`ditto_live` in `pubspec.yaml` \u002F `pubspec.lock`), JavaScript (`@dittolive\u002Fditto` in `package.json`), Kotlin (`com.ditto:ditto-kotlin` in Gradle files), or Swift (`DittoSwift` in `Package.swift`, `Package.resolved`, or the Xcode project). These rules target SDK 5.2.0; for devices that still run 5.1.0, also apply `§ Known Issues in SDK 5.1.0`. **Note (SDK 5.1.0 and 5.2.0)** and **Note (SDK 5.1.0)** mark easy-to-miss behavior seen on those releases, with the safe pattern; **(SDK 5.1+)** \u002F **(SDK 5.2+)** mark features introduced in that release.\n- For API calls, Grep the outline of that SDK's page, `${CLAUDE_SKILL_DIR}\u002F..\u002Fguide\u002Freference\u002Fbest-practices\u002Fplatforms\u002F\u003Csdk>.md` (`flutter`, `javascript`, `kotlin`, `swift`), with `^#{1,3} ` and read only the section you need, not the whole page; sections are named `\u003CTopic> in \u003CSDK>`. DQL examples: `examples\u002F*.sql` (every SDK); API examples: `examples\u002F\u003Csdk>\u002F`, with the same base names in every SDK.\n- `§ \u003CHeading>` cites the full guide: Grep the heading as a fixed string in `best-practices\u002F` and `knowledge\u002F` under `${CLAUDE_SKILL_DIR}\u002F..\u002Fguide\u002Freference\u002F`, then read that section.\n- Report each finding at the severity of its item in `§ Anti-Pattern Checklist` (the checklist decides; Grep a phrase of the item there). The labels below rank the rules, not each item in them.\n\n## Prevents\n\n- DQL built with string interpolation; filters that silently drop documents (MISSING vs NULL, `IN (:values)`, `ANY ... SATISFIES`)\n- \"Synced data does not show\": no subscription matches it, or none after a reopen\n- Subscriptions rejected at registration or re-registered on every filter change\n- Unreleased subscriptions and observers; Flutter `onChange` observers retaining every result\n- Upserts that rewrite unchanged data; `JOIN` queries failing without an index; retained result objects\n\n## Workflow\n\nData does not sync? First triage:\n- No peer connects, `sync.start()` throws, or login fails: `sdk-setup`, section *Diagnose: Sync Never Starts or Devices Do Not Connect*.\n- Peers connect but documents are missing: subscriptions here (rules 3 and 4). Evicted or deleted documents come back: `storage-lifecycle`.\n\nEvery DQL statement runs against the **local store**. Only `ditto.sync.registerSubscription` makes data sync from remote peers (while sync is running); `ditto.store.execute` (snapshot), `ditto.store.registerObserver` (live), and `ditto.store.transaction` read local data and never cause sync.\n\nSubscriptions are long-lived, scoped by stable partition keys; observers and `execute` calls are short-lived and screen-specific. A result describes this device only: empty may mean nothing has synced yet or no subscription matches, not that data is absent (no defaults or uniqueness checks from it). Read synced data with an observer, not one `execute` after subscribing; subscribe to all a query, total, or `JOIN` reads. A returned write is known to be local only (`§ Monitoring Sync Status`).\n\n`§ Where Queries Run`, `§ When Data Does Not Sync`, `§ When a Statement Fails or Returns Nothing`\n\nA screen that shows synced data:\n\n```\nProgress:\n- [ ] 1. Subscription: SELECT * FROM c WHERE \u003Cstable partition key> = :param, owned by an app\u002Ffeature service\n- [ ] 2. Indexes: CREATE INDEX IF NOT EXISTS at startup for filter, sort, and JOIN keys\n- [ ] 3. Observer: registered once when the screen's owner starts (not in render code), with ORDER BY (+ _id tie-breaker) and LIMIT if large\n- [ ] 4. Callback: copy row values into plain data or models; update UI state; no slow work\n- [ ] 5. Cleanup: release the observer when its owner goes away; cancel subscriptions on logout or workspace change\n```\n\n## Rules\n\n### 1. Pass values as parameters (CRITICAL)\n\nReference values with `:name` and pass them as arguments. Names are case-sensitive; a placeholder without an argument fails. Interpolation allows DQL injection, breaks on quotes and backslashes, and defeats the shared statement cache.\n**✅ DO**: parameters for IDs, user input, dates, `LIMIT`\u002F`OFFSET`, and whole documents (`INSERT INTO orders DOCUMENTS (:order)`); arrays for membership (`status IN :statuses`); plain JSON values (UTC date strings; *Arguments and value types in \u003CSDK>*).\n**❌ DON'T**: build statements with interpolation or concatenation; write `IN (:statuses)` (the array becomes one list element and nothing matches).\n\n`§ Parameters and Literals` · Examples: [dql-queries-good.sql](examples\u002Fdql-queries-good.sql), [dql-queries-bad.sql](examples\u002Fdql-queries-bad.sql)\n\n### 2. Treat MISSING and NULL explicitly in filters (CRITICAL)\n\nA comparison with a missing or null field is neither true nor false, so the row is dropped.\n\n| `WHERE` expression | Matches `false` | `null` | missing |\n|---|---|---|---|\n| `isDeleted != true` | ✓ | | | \u003C!-- lint-ignore -->\n| `coalesce(isDeleted, false) = false` | ✓ | ✓ | ✓ |\n| `isDeleted IS NOT NULL` | ✓ | | ✓ | \u003C!-- lint-ignore -->\n| `isDeleted IS NOT MISSING` | ✓ | ✓ | |\n\n**✅ DO**: filter optional booleans with `coalesce(field, default)` (`WHERE coalesce(isDeleted, false) = false`); test absence with `IS MISSING` \u002F `IS NOT MISSING`; remove a field with `UNSET`.\n**❌ DON'T**: use `field != true` or `NOT field` for \"false or not set\"; use `IS NOT NULL` to test existence. \u003C!-- lint-ignore -->\n\n`§ MISSING and NULL`\n\n### 3. Subscribe with SELECT * and stable partition keys (CRITICAL)\n\nA subscription selects whole documents from one collection: `SELECT * FROM \u003Ccollection> [WHERE \u003Ccondition>]`. `registerSubscription` fails for the features below, even before sync starts.\n\n| Rejected in subscriptions | Do instead |\n|---|---|\n| Projections, aggregates, `DISTINCT`, `GROUP BY` | Subscribe with `SELECT *`; project in local queries |\n| `JOIN` | Subscribe to each collection separately; join locally |\n| `USE IDS` | `WHERE _id IN :ids` |\n| `LIMIT`, `ORDER BY` | Sort and limit in the local query or observer |\n\nKeep `DQL_RESTRICT_SUBSCRIPTIONS` at its default (`true`); `false` allows stateful `LIMIT`\u002F`ORDER BY` subscriptions whose `LIMIT` bounds only the first download ([details](reference\u002Fsubscriptions-and-observers.md#subscription-rules)). Bound what syncs with `WHERE` (a stable key or a time window).\n**✅ DO**: filter by stable partition keys (tenant, store, region, team); use the same subscriptions on peers in the same role; keep predicates flat; give relay devices at least the subscriptions of the devices behind them.\n**❌ DON'T**: subscribe to entire large collections \"just in case\" (except small reference data that every device needs); filter subscriptions on fields that change often (`status`, `assignee`): a document that stops matching stays as a stale copy that local queries return, without later edits or its deletion.\n\nSoft delete: relaying devices keep flagged documents in their subscriptions; hide them locally with `coalesce(isDeleted, false) = false` (`storage-lifecycle`).\n\n`§ Subscription Rules`, `§ Scope Balancing`, `§ Soft delete, subscriptions, and cleanup`\n\n### 4. Own subscriptions in a long-lived service and cancel them (CRITICAL)\n\nChanging subscriptions makes peers re-evaluate which documents to send; avoid changing them more often than about every 15 minutes.\n**✅ DO**:\n- Register at app start (every time Ditto opens; not persisted), after login, or on entering a workspace, in an app- or feature-level service; keep every subscription and release it (`cancel()`, `close()` in Kotlin) on logout or workspace change\n- Change the **observer**, not the subscription, when the user changes a filter, search term, tab, or sort order\n- Cancel subscriptions **before** evicting their data; cancelling alone does not delete local data\n\n**❌ DON'T**: register in render code (`build()`, a SwiftUI `body`, a composable, a React render) or on every screen visit; drop a reference without releasing it (do not rely on garbage collection).\n\n`sync.stop()` pauses subscriptions (resumed by `start()`); closing Ditto cancels them.\n\n> **Note (SDK 5.1.0 and 5.2.0):** In Flutter, do not read `queryArguments`, `queryArgumentsJsonString`, or `queryArgumentsCborBytes` from `ditto.sync.subscriptions` elements; for subscriptions without arguments this ended the app or threw in testing. Read only `queryString` and `isCancelled`; keep your own references.\n\n`§ Subscription Lifecycle`, `§ Sync stop, close, and inspection` · Examples: `subscription-lifecycle-good` and `subscription-lifecycle-bad` in `examples\u002F\u003Csdk>\u002F`\n\n### 5. Filter membership with IN :values (CRITICAL)\n\n| Goal | Expression |\n|---|---|\n| Field equals one of several values | `status IN :statuses` (array parameter; can use an index) |\n| Array field contains a value | `:tag IN tags` or `array_contains(tags, :tag)` (no index) |\n| ❌ Array parameter in parentheses | `status IN (:statuses)` matches nothing |\n\n> **Note (SDK 5.1.0 and 5.2.0):** `ANY ... SATISFIES ... END` in `WHERE` over a parameter or literal array returns no rows. Use `status IN :statuses` or `array_contains(:statuses, status)`. A subscription with it still syncs the documents; only the list is empty.\n\n`§ Filtering by Membership`\n\n### 6. Upsert with DO UPDATE_LOCAL_DIFF and update fields, not documents (CRITICAL)\n\n| `ON ID CONFLICT` | Existing document |\n|---|---|\n| `FAIL` (default) | Statement fails |\n| `DO NOTHING` | Unchanged |\n| `DO UPDATE` | Supplied fields written even if identical (observers can fire again) |\n| `DO UPDATE_LOCAL_DIFF` | Only differing fields written; nothing written if nothing changed |\n\n**✅ DO**: `INSERT INTO products DOCUMENTS (:item) ON ID CONFLICT DO UPDATE_LOCAL_DIFF` for upserts and re-imports; change only changed fields with `UPDATE ... SET`; remove fields with `UNSET`; replace an object with `UNSET obj` then `SET obj = :value` in one transaction.\n**❌ DON'T**: read-modify-write whole documents with `DO UPDATE` or `DO UPDATE_LOCAL_DIFF` (a stale in-memory value differs from the stored one and is written back); expect `DO UPDATE` or `SET obj = {...}` to remove keys (by default, objects merge; see `data-modeling`).\n\n`§ INSERT and Conflict Handling`, `§ UPDATE` · Example: [dql-writes.sql](examples\u002Fdql-writes.sql)\n\n### 7. Index the inner collection of a JOIN (SDK 5.1+) (CRITICAL)\n\nJoins (`INNER`, `LEFT`, `RIGHT` as first join only) run on local data. The inner collection's join key needs an index, or the join must be on its `_id`; otherwise the query fails (`disallowed without appropriate index support`).\n**✅ DO**: `CREATE INDEX IF NOT EXISTS idx_orders_customerId ON orders (customerId)` for `... JOIN orders o ON o.customerId = c._id`; qualify every field with its alias and alias colliding fields; subscribe to each joined collection separately; filter the outer collection selectively.\n**❌ DON'T**: use `JOIN` in subscriptions or on Ditto Server; use `USE INDEX ''` on large collections to silence the index error.\n\n`§ Joining Collections (SDK 5.1+)`\n\n### 8. Copy values out of query results right away (CRITICAL)\n\nA result's rows (`items`) and their values reference native memory. In Kotlin, a result is a resource that you `close()` (or read inside the mapping function of `execute`).\n**✅ DO**: read the rows once and convert them to plain values or models; project only the fields you need; read the mutated document IDs once; track a commit ID only when the result lists mutated document IDs.\n**❌ DON'T**: store result or row objects in state, caches, or across observer callbacks; change a row's value to edit the document (write with `UPDATE`); in Kotlin, use typed accessors such as `.string` on fields that can be missing or `null` (they throw `DittoException.FatalException`; use the `...OrNull` forms).\n\n`§ Working with Query Results`, `§ Query results in Kotlin` · Example: `query-result-handling` in `examples\u002F\u003Csdk>\u002F` · Member table: [reference\u002Fquery-optimization.md](reference\u002Fquery-optimization.md#query-results)\n\n### 9. Quote every key in inline object literals (CRITICAL)\n\nUnquoted keys are rejected in `INSERT` and silently produce `{}` in `SELECT`; prefer document parameters. Backticks quote identifiers and reserved words (`collection`).\n\n\u003C!-- expect-error -->\n```sql\n-- ❌ BAD: Rejected (\"Cannot convert to a literal\")\nINSERT INTO orders DOCUMENTS ({_id: 'order-1', status: 'open'})\n```\n\n✅ Quoted: `DOCUMENTS ({'_id': 'order-1', 'status': 'open'})`.\n\n`§ Quote every key in inline object literals`, `§ Literals` · Details: [reference\u002Fdql-reference.md](reference\u002Fdql-reference.md#literals-and-identifiers)\n\n### 10. Delete and evict by ID with WHERE (CRITICAL)\n\nSelect by ID with `WHERE _id = :id` or `WHERE _id IN :ids`: planned as an ID lookup, it works on every release. On SDK 5.1.0, `DELETE` or `EVICT` with `USE IDS` and no `WHERE` predicate removes nothing, without an error (`§ Known Issues in SDK 5.1.0`).\n\n`DELETE` removes on all peers (tombstone); `EVICT` on this device only. Strategy: `storage-lifecycle`.\n\n`§ DELETE and EVICT`\n\n### 11. Register each observer once per owner and release it (HIGH)\n\nAn observer runs its query and holds memory until released. Give it one owner (a screen, view model, or service), register it when the owner starts, and release it when the owner goes away.\n\n| SDK | Recommended pattern | Pitfalls |\n|---|---|---|\n| Flutter | `registerObserver` **without** `onChange`; consume `changes` with one `StreamSubscription`; cancel both in `dispose()` | `changes` is single-subscription; cancelling its stream subscription does not cancel the observer |\n| JavaScript | `registerObserver(query, handler, args)` with a synchronous handler; `cancel()` in the component's cleanup | `async` handlers are not awaited |\n| Kotlin | `observe(...)` (a `Flow`) collected in the owner's scope, or `registerObserver(query, args) { }` | Release: cancel the collector (`observe`) or `close()` |\n| Swift | `registerObserver(query:arguments:handler:)`; keep the `DittoStoreObserver` and `cancel()` it | Delivered on the main queue by default |\n\n> **Note (SDK 5.1.0 and 5.2.0):** In Flutter, with `onChange` (and always with `registerObserverV2`), every result is also queued in `changes`, and memory grows until something listens: listen right after registering, or drain it (`observer.changes.listen((_) {})`).\n\n**✅ DO**: register in the owner's start hook, and again when the query's inputs change; give each screen region its own small observer; use `COUNT(*)` for badges; keep callbacks short.\n**❌ DON'T**: register in render code; create an observer per list item; observe a whole collection at the screen root; rely on garbage collection or `close()`.\n\n`§ Observer Lifecycle`, `§ Store Observers in Flutter`, `§ Observer lifecycle in Flutter` · Examples: `observer-patterns-good` and `observer-patterns-bad` in `examples\u002F\u003Csdk>\u002F` · Details: [reference\u002Fsubscriptions-and-observers.md](reference\u002Fsubscriptions-and-observers.md#observer-lifecycle)\n\n### 12. Hand slow observer work to performance-observability (HIGH)\n\nFor slow or `async` per-update work, use the SDK's backpressure API **(SDK 5.1+)**: Flutter `registerObserverV2` or `registerObserverWithSignalNext` (both Experimental), JavaScript `registerObserverWithSignalNext`, Swift `handlerWithSignalNext:`, Kotlin a suspending handler or `collect`.\n\n`§ Backpressure (SDK 5.1+)`, `§ Choosing an observer API` · Example: `observer-backpressure` in `examples\u002F\u003Csdk>\u002F`\n\n### 13. Put ORDER BY and LIMIT in local queries, with a tie-breaker (MEDIUM)\n\nWithout `ORDER BY` (observers included) order is not guaranteed. Add a unique tie-breaker (`ORDER BY createdAt DESC, _id`); combine `LIMIT`\u002F`OFFSET` with `ORDER BY`; prefer keyset pagination. Existence: `SELECT _id ... LIMIT 1`; counts: `COUNT(*)`.\n\n`§ ORDER BY`, `§ LIMIT and OFFSET` · Details: [reference\u002Fdql-reference.md](reference\u002Fdql-reference.md#order-by-limit-and-offset), [reference\u002Fquery-optimization.md](reference\u002Fquery-optimization.md#pagination)\n\n### 14. Use RETURNING instead of write-then-read (SDK 5.1+) (MEDIUM)\n\n`RETURNING` on `INSERT`, `UPDATE`, `DELETE`, or `EVICT` returns the affected documents in `items` (after the update; before removal).\n\n`§ RETURNING (SDK 5.1+)` · Details: [reference\u002Fdql-reference.md](reference\u002Fdql-reference.md#returning-sdk-51)\n\n### 15. Repeat expressions in GROUP BY and HAVING (MEDIUM)\n\n`GROUP BY` and `HAVING` cannot reference projection aliases (`ORDER BY` can); every non-aggregate projection must be a `GROUP BY` key. Aggregates other than `COUNT` return MISSING over zero rows: `ifmissing(SUM(total), 0)`. `COUNT(field)` skips `false`.\n\n`§ Aggregates`, `§ GROUP BY and HAVING` · Details: [reference\u002Fdql-reference.md](reference\u002Fdql-reference.md#projections-distinct-and-aggregates)\n\n### 16. Use a differ only for item-level changes (MEDIUM)\n\nThe differ (`Differ`; `DittoDiffer` in Swift; Kotlin's observer `DittoDiff`) reports insertions, deletions, updates, and moves by `_id`; it is expensive, so bound diffed queries with `LIMIT`. Use it only for explicit insert, remove, and move calls such as an animated list.\n\n`§ Diffing Results` · Example: `observer-differ` in `examples\u002F\u003Csdk>\u002F`\n\n## Checklist\n\n- [ ] Values passed as `:parameters`; arrays as `IN :values` (no parentheses)\n- [ ] Inline object literal keys quoted; documents passed as `DOCUMENTS (:doc)`\n- [ ] Optional booleans filtered with `coalesce(field, false)`; existence tested with `IS [NOT] MISSING`\n- [ ] No `ANY` or `EVERY ... SATISFIES` over a parameter or literal array in `WHERE`\n- [ ] `ORDER BY` with `_id` tie-breaker wherever order matters; `LIMIT` combined with `ORDER BY`\n- [ ] `GROUP BY` \u002F `HAVING` repeat expressions; empty aggregates wrapped with `ifmissing`\n- [ ] JOIN inner keys indexed (or joined on `_id`); fields qualified with aliases\n- [ ] Upserts use `ON ID CONFLICT DO UPDATE_LOCAL_DIFF`; fields removed with `UNSET`\n- [ ] `DELETE` \u002F `EVICT` by ID use `WHERE _id IN :ids`\n- [ ] Subscriptions: `SELECT *` on stable partition keys, owned by a service, registered again after every `Ditto.open()`, cancelled on logout and before evicting, not re-registered for UI filters\n- [ ] Every local query, observer, aggregate, and `JOIN` reads only documents that a subscription covers, with the same arguments\n- [ ] No empty result or count of 0 taken as proof that data does not exist; no single `execute` right after subscribing\n- [ ] Observers registered once per owner, outside render code, and released when the owner goes away (Flutter: no `onChange`; stream subscription and observer cancelled in `dispose()`)\n- [ ] Callbacks copy row values into plain data; no result or row object retained (Kotlin: `...OrNull` accessors for optional fields)\n\n## More\n\n- Reference: [reference\u002Fdql-reference.md](reference\u002Fdql-reference.md) (DQL syntax and semantics), [reference\u002Fsubscriptions-and-observers.md](reference\u002Fsubscriptions-and-observers.md) (subscription and observer APIs and lifecycle), [reference\u002Fquery-optimization.md](reference\u002Fquery-optimization.md) (result members, pagination, index-friendly predicates)\n- Examples: [examples\u002F](examples\u002F) - `.sql` for every SDK, `examples\u002F\u003Csdk>\u002F` for API code; `-good` \u002F `-bad` pairs\n- Related skills: `data-modeling` (merge semantics), `storage-lifecycle` (DELETE\u002FEVICT strategy), `performance-observability` (backpressure, indexes, logging), `transactions-attachments`, `sdk-setup` (connection problems)\n","# Ditto Query and Sync Patterns\n\nDQL statements, subscriptions, and store observers: what syncs, what a query sees, and cheap observers and upserts. Targets Ditto SDK 5.2.0 in every SDK.\n\n## Before You Apply\n\n- Identify the project's SDK and version: Flutter (`ditto_live` in `pubspec.yaml` \u002F `pubspec.lock`), JavaScript (`@dittolive\u002Fditto` in `package.json`), Kotlin (`com.ditto:ditto-kotlin` in Gradle files), or Swift (`DittoSwift` in `Package.swift`, `Package.resolved`, or the Xcode project). These rules target SDK 5.2.0; for devices that still run 5.1.0, also apply `§ Known Issues in SDK 5.1.0`. **Note (SDK 5.1.0 and 5.2.0)** and **Note (SDK 5.1.0)** mark easy-to-miss behavior seen on those releases, with the safe pattern; **(SDK 5.1+)** \u002F **(SDK 5.2+)** mark features introduced in that release.\n- For API calls, Grep the outline of that SDK's page, `${CLAUDE_SKILL_DIR}\u002F..\u002Fguide\u002Freference\u002Fbest-practices\u002Fplatforms\u002F\u003Csdk>.md` (`flutter`, `javascript`, `kotlin`, `swift`), with `^#{1,3} ` and read only the section you need, not the whole page; sections are named `\u003CTopic> in \u003CSDK>`. DQL examples: `examples\u002F*.sql` (every SDK); API examples: `examples\u002F\u003Csdk>\u002F`, with the same base names in every SDK.\n- `§ \u003CHeading>` cites the full guide: Grep the heading as a fixed string in `best-practices\u002F` and `knowledge\u002F` under `${CLAUDE_SKILL_DIR}\u002F..\u002Fguide\u002Freference\u002F`, then read that section.\n- Report each finding at the severity of its item in `§ Anti-Pattern Checklist` (the checklist decides; Grep a phrase of the item there). The labels below rank the rules, not each item in them.\n\n## Prevents\n\n- DQL built with string interpolation; filters that silently drop documents (MISSING vs NULL, `IN (:values)`, `ANY ... SATISFIES`)\n- \"Synced data does not show\": no subscription matches it, or none after a reopen\n- Subscriptions rejected at registration or re-registered on every filter change\n- Unreleased subscriptions and observers; Flutter `onChange` observers retaining every result\n- Upserts that rewrite unchanged data; `JOIN` queries failing without an index; retained result objects\n\n## Workflow\n\nData does not sync? First triage:\n- No peer connects, `sync.start()` throws, or login fails: `sdk-setup`, section *Diagnose: Sync Never Starts or Devices Do Not Connect*.\n- Peers connect but documents are missing: subscriptions here (rules 3 and 4). Evicted or deleted documents come back: `storage-lifecycle`.\n\nEvery DQL statement runs against the **local store**. Only `ditto.sync.registerSubscription` makes data sync from remote peers (while sync is running); `ditto.store.execute` (snapshot), `ditto.store.registerObserver` (live), and `ditto.store.transaction` read local data and never cause sync.\n\nSubscriptions are long-lived, scoped by stable partition keys; observers and `execute` calls are short-lived and screen-specific. A result describes this device only: empty may mean nothing has synced yet or no subscription matches, not that data is absent (no defaults or uniqueness checks from it). Read synced data with an observer, not one `execute` after subscribing; subscribe to all a query, total, or `JOIN` reads. A returned write is known to be local only (`§ Monitoring Sync Status`).\n\n`§ Where Queries Run`, `§ When Data Does Not Sync`, `§ When a Statement Fails or Returns Nothing`\n\nA screen that shows synced data:\n\n```\nProgress:\n- [ ] 1. Subscription: SELECT * FROM c WHERE \u003Cstable partition key> = :param, owned by an app\u002Ffeature service\n- [ ] 2. Indexes: CREATE INDEX IF NOT EXISTS at startup for filter, sort, and JOIN keys\n- [ ] 3. Observer: registered once when the screen's owner starts (not in render code), with ORDER BY (+ _id tie-breaker) and LIMIT if large\n- [ ] 4. Callback: copy row values into plain data or models; update UI state; no slow work\n- [ ] 5. Cleanup: release the observer when its owner goes away; cancel subscriptions on logout or workspace change\n```\n\n## Rules\n\n### 1. Pass values as parameters (CRITICAL)\n\nReference values with `:name` and pass them as arguments. Names are case-sensitive; a placeholder without an argument fails. Interpolation allows DQL injection, breaks on quotes and backslashes, and defeats the shared statement cache.\n**✅ DO**: parameters for IDs, user input, dates, `LIMIT`\u002F`OFFSET`, and whole documents (`INSERT INTO orders DOCUMENTS (:order)`); arrays for membership (`status IN :statuses`); plain JSON values (UTC date strings; *Arguments and value types in \u003CSDK>*).\n**❌ DON'T**: build statements with interpolation or concatenation; write `IN (:statuses)` (the array becomes one list element and nothing matches).\n\n`§ Parameters and Literals` · Examples: [dql-queries-good.sql](examples\u002Fdql-queries-good.sql), [dql-queries-bad.sql](examples\u002Fdql-queries-bad.sql)\n\n### 2. Treat MISSING and NULL explicitly in filters (CRITICAL)\n\nA comparison with a missing or null field is neither true nor false, so the row is dropped.\n\n| `WHERE` expression | Matches `false` | `null` | missing |\n|---|---|---|---|\n| `isDeleted != true` | ✓ | | | \u003C!-- lint-ignore -->\n| `coalesce(isDeleted, false) = false` | ✓ | ✓ | ✓ |\n| `isDeleted IS NOT NULL` | ✓ | | ✓ | \u003C!-- lint-ignore -->\n| `isDeleted IS NOT MISSING` | ✓ | ✓ | |\n\n**✅ DO**: filter optional booleans with `coalesce(field, default)` (`WHERE coalesce(isDeleted, false) = false`); test absence with `IS MISSING` \u002F `IS NOT MISSING`; remove a field with `UNSET`.\n**❌ DON'T**: use `field != true` or `NOT field` for \"false or not set\"; use `IS NOT NULL` to test existence. \u003C!-- lint-ignore -->\n\n`§ MISSING and NULL`\n\n### 3. Subscribe with SELECT * and stable partition keys (CRITICAL)\n\nA subscription selects whole documents from one collection: `SELECT * FROM \u003Ccollection> [WHERE \u003Ccondition>]`. `registerSubscription` fails for the features below, even before sync starts.\n\n| Rejected in subscriptions | Do instead |\n|---|---|\n| Projections, aggregates, `DISTINCT`, `GROUP BY` | Subscribe with `SELECT *`; project in local queries |\n| `JOIN` | Subscribe to each collection separately; join locally |\n| `USE IDS` | `WHERE _id IN :ids` |\n| `LIMIT`, `ORDER BY` | Sort and limit in the local query or observer |\n\nKeep `DQL_RESTRICT_SUBSCRIPTIONS` at its default (`true`); `false` allows stateful `LIMIT`\u002F`ORDER BY` subscriptions whose `LIMIT` bounds only the first download ([details](reference\u002Fsubscriptions-and-observers.md#subscription-rules)). Bound what syncs with `WHERE` (a stable key or a time window).\n**✅ DO**: filter by stable partition keys (tenant, store, region, team); use the same subscriptions on peers in the same role; keep predicates flat; give relay devices at least the subscriptions of the devices behind them.\n**❌ DON'T**: subscribe to entire large collections \"just in case\" (except small reference data that every device needs); filter subscriptions on fields that change often (`status`, `assignee`): a document that stops matching stays as a stale copy that local queries return, without later edits or its deletion.\n\nSoft delete: relaying devices keep flagged documents in their subscriptions; hide them locally with `coalesce(isDeleted, false) = false` (`storage-lifecycle`).\n\n`§ Subscription Rules`, `§ Scope Balancing`, `§ Soft delete, subscriptions, and cleanup`\n\n### 4. Own subscriptions in a long-lived service and cancel them (CRITICAL)\n\nChanging subscriptions makes peers re-evaluate which documents to send; avoid changing them more often than about every 15 minutes.\n**✅ DO**:\n- Register at app start (every time Ditto opens; not persisted), after login, or on entering a workspace, in an app- or feature-level service; keep every subscription and release it (`cancel()`, `close()` in Kotlin) on logout or workspace change\n- Change the **observer**, not the subscription, when the user changes a filter, search term, tab, or sort order\n- Cancel subscriptions **before** evicting their data; cancelling alone does not delete local data\n\n**❌ DON'T**: register in render code (`build()`, a SwiftUI `body`, a composable, a React render) or on every screen visit; drop a reference without releasing it (do not rely on garbage collection).\n\n`sync.stop()` pauses subscriptions (resumed by `start()`); closing Ditto cancels them.\n\n> **Note (SDK 5.1.0 and 5.2.0):** In Flutter, do not read `queryArguments`, `queryArgumentsJsonString`, or `queryArgumentsCborBytes` from `ditto.sync.subscriptions` elements; for subscriptions without arguments this ended the app or threw in testing. Read only `queryString` and `isCancelled`; keep your own references.\n\n`§ Subscription Lifecycle`, `§ Sync stop, close, and inspection` · Examples: `subscription-lifecycle-good` and `subscription-lifecycle-bad` in `examples\u002F\u003Csdk>\u002F`\n\n### 5. Filter membership with IN :values (CRITICAL)\n\n| Goal | Expression |\n|---|---|\n| Field equals one of several values | `status IN :statuses` (array parameter; can use an index) |\n| Array field contains a value | `:tag IN tags` or `array_contains(tags, :tag)` (no index) |\n| ❌ Array parameter in parentheses | `status IN (:statuses)` matches nothing |\n\n> **Note (SDK 5.1.0 and 5.2.0):** `ANY ... SATISFIES ... END` in `WHERE` over a parameter or literal array returns no rows. Use `status IN :statuses` or `array_contains(:statuses, status)`. A subscription with it still syncs the documents; only the list is empty.\n\n`§ Filtering by Membership`\n\n### 6. Upsert with DO UPDATE_LOCAL_DIFF and update fields, not documents (CRITICAL)\n\n| `ON ID CONFLICT` | Existing document |\n|---|---|\n| `FAIL` (default) | Statement fails |\n| `DO NOTHING` | Unchanged |\n| `DO UPDATE` | Supplied fields written even if identical (observers can fire again) |\n| `DO UPDATE_LOCAL_DIFF` | Only differing fields written; nothing written if nothing changed |\n\n**✅ DO**: `INSERT INTO products DOCUMENTS (:item) ON ID CONFLICT DO UPDATE_LOCAL_DIFF` for upserts and re-imports; change only changed fields with `UPDATE ... SET`; remove fields with `UNSET`; replace an object with `UNSET obj` then `SET obj = :value` in one transaction.\n**❌ DON'T**: read-modify-write whole documents with `DO UPDATE` or `DO UPDATE_LOCAL_DIFF` (a stale in-memory value differs from the stored one and is written back); expect `DO UPDATE` or `SET obj = {...}` to remove keys (by default, objects merge; see `data-modeling`).\n\n`§ INSERT and Conflict Handling`, `§ UPDATE` · Example: [dql-writes.sql](examples\u002Fdql-writes.sql)\n\n### 7. Index the inner collection of a JOIN (SDK 5.1+) (CRITICAL)\n\nJoins (`INNER`, `LEFT`, `RIGHT` as first join only) run on local data. The inner collection's join key needs an index, or the join must be on its `_id`; otherwise the query fails (`disallowed without appropriate index support`).\n**✅ DO**: `CREATE INDEX IF NOT EXISTS idx_orders_customerId ON orders (customerId)` for `... JOIN orders o ON o.customerId = c._id`; qualify every field with its alias and alias colliding fields; subscribe to each joined collection separately; filter the outer collection selectively.\n**❌ DON'T**: use `JOIN` in subscriptions or on Ditto Server; use `USE INDEX ''` on large collections to silence the index error.\n\n`§ Joining Collections (SDK 5.1+)`\n\n### 8. Copy values out of query results right away (CRITICAL)\n\nA result's rows (`items`) and their values reference native memory. In Kotlin, a result is a resource that you `close()` (or read inside the mapping function of `execute`).\n**✅ DO**: read the rows once and convert them to plain values or models; project only the fields you need; read the mutated document IDs once; track a commit ID only when the result lists mutated document IDs.\n**❌ DON'T**: store result or row objects in state, caches, or across observer callbacks; change a row's value to edit the document (write with `UPDATE`); in Kotlin, use typed accessors such as `.string` on fields that can be missing or `null` (they throw `DittoException.FatalException`; use the `...OrNull` forms).\n\n`§ Working with Query Results`, `§ Query results in Kotlin` · Example: `query-result-handling` in `examples\u002F\u003Csdk>\u002F` · Member table: [reference\u002Fquery-optimization.md](reference\u002Fquery-optimization.md#query-results)\n\n### 9. Quote every key in inline object literals (CRITICAL)\n\nUnquoted keys are rejected in `INSERT` and silently produce `{}` in `SELECT`; prefer document parameters. Backticks quote identifiers and reserved words (`collection`).\n\n\u003C!-- expect-error -->\n```sql\n-- ❌ BAD: Rejected (\"Cannot convert to a literal\")\nINSERT INTO orders DOCUMENTS ({_id: 'order-1', status: 'open'})\n```\n\n✅ Quoted: `DOCUMENTS ({'_id': 'order-1', 'status': 'open'})`.\n\n`§ Quote every key in inline object literals`, `§ Literals` · Details: [reference\u002Fdql-reference.md](reference\u002Fdql-reference.md#literals-and-identifiers)\n\n### 10. Delete and evict by ID with WHERE (CRITICAL)\n\nSelect by ID with `WHERE _id = :id` or `WHERE _id IN :ids`: planned as an ID lookup, it works on every release. On SDK 5.1.0, `DELETE` or `EVICT` with `USE IDS` and no `WHERE` predicate removes nothing, without an error (`§ Known Issues in SDK 5.1.0`).\n\n`DELETE` removes on all peers (tombstone); `EVICT` on this device only. Strategy: `storage-lifecycle`.\n\n`§ DELETE and EVICT`\n\n### 11. Register each observer once per owner and release it (HIGH)\n\nAn observer runs its query and holds memory until released. Give it one owner (a screen, view model, or service), register it when the owner starts, and release it when the owner goes away.\n\n| SDK | Recommended pattern | Pitfalls |\n|---|---|---|\n| Flutter | `registerObserver` **without** `onChange`; consume `changes` with one `StreamSubscription`; cancel both in `dispose()` | `changes` is single-subscription; cancelling its stream subscription does not cancel the observer |\n| JavaScript | `registerObserver(query, handler, args)` with a synchronous handler; `cancel()` in the component's cleanup | `async` handlers are not awaited |\n| Kotlin | `observe(...)` (a `Flow`) collected in the owner's scope, or `registerObserver(query, args) { }` | Release: cancel the collector (`observe`) or `close()` |\n| Swift | `registerObserver(query:arguments:handler:)`; keep the `DittoStoreObserver` and `cancel()` it | Delivered on the main queue by default |\n\n> **Note (SDK 5.1.0 and 5.2.0):** In Flutter, with `onChange` (and always with `registerObserverV2`), every result is also queued in `changes`, and memory grows until something listens: listen right after registering, or drain it (`observer.changes.listen((_) {})`).\n\n**✅ DO**: register in the owner's start hook, and again when the query's inputs change; give each screen region its own small observer; use `COUNT(*)` for badges; keep callbacks short.\n**❌ DON'T**: register in render code; create an observer per list item; observe a whole collection at the screen root; rely on garbage collection or `close()`.\n\n`§ Observer Lifecycle`, `§ Store Observers in Flutter`, `§ Observer lifecycle in Flutter` · Examples: `observer-patterns-good` and `observer-patterns-bad` in `examples\u002F\u003Csdk>\u002F` · Details: [reference\u002Fsubscriptions-and-observers.md](reference\u002Fsubscriptions-and-observers.md#observer-lifecycle)\n\n### 12. Hand slow observer work to performance-observability (HIGH)\n\nFor slow or `async` per-update work, use the SDK's backpressure API **(SDK 5.1+)**: Flutter `registerObserverV2` or `registerObserverWithSignalNext` (both Experimental), JavaScript `registerObserverWithSignalNext`, Swift `handlerWithSignalNext:`, Kotlin a suspending handler or `collect`.\n\n`§ Backpressure (SDK 5.1+)`, `§ Choosing an observer API` · Example: `observer-backpressure` in `examples\u002F\u003Csdk>\u002F`\n\n### 13. Put ORDER BY and LIMIT in local queries, with a tie-breaker (MEDIUM)\n\nWithout `ORDER BY` (observers included) order is not guaranteed. Add a unique tie-breaker (`ORDER BY createdAt DESC, _id`); combine `LIMIT`\u002F`OFFSET` with `ORDER BY`; prefer keyset pagination. Existence: `SELECT _id ... LIMIT 1`; counts: `COUNT(*)`.\n\n`§ ORDER BY`, `§ LIMIT and OFFSET` · Details: [reference\u002Fdql-reference.md](reference\u002Fdql-reference.md#order-by-limit-and-offset), [reference\u002Fquery-optimization.md](reference\u002Fquery-optimization.md#pagination)\n\n### 14. Use RETURNING instead of write-then-read (SDK 5.1+) (MEDIUM)\n\n`RETURNING` on `INSERT`, `UPDATE`, `DELETE`, or `EVICT` returns the affected documents in `items` (after the update; before removal).\n\n`§ RETURNING (SDK 5.1+)` · Details: [reference\u002Fdql-reference.md](reference\u002Fdql-reference.md#returning-sdk-51)\n\n### 15. Repeat expressions in GROUP BY and HAVING (MEDIUM)\n\n`GROUP BY` and `HAVING` cannot reference projection aliases (`ORDER BY` can); every non-aggregate projection must be a `GROUP BY` key. Aggregates other than `COUNT` return MISSING over zero rows: `ifmissing(SUM(total), 0)`. `COUNT(field)` skips `false`.\n\n`§ Aggregates`, `§ GROUP BY and HAVING` · Details: [reference\u002Fdql-reference.md](reference\u002Fdql-reference.md#projections-distinct-and-aggregates)\n\n### 16. Use a differ only for item-level changes (MEDIUM)\n\nThe differ (`Differ`; `DittoDiffer` in Swift; Kotlin's observer `DittoDiff`) reports insertions, deletions, updates, and moves by `_id`; it is expensive, so bound diffed queries with `LIMIT`. Use it only for explicit insert, remove, and move calls such as an animated list.\n\n`§ Diffing Results` · Example: `observer-differ` in `examples\u002F\u003Csdk>\u002F`\n\n## Checklist\n\n- [ ] Values passed as `:parameters`; arrays as `IN :values` (no parentheses)\n- [ ] Inline object literal keys quoted; documents passed as `DOCUMENTS (:doc)`\n- [ ] Optional booleans filtered with `coalesce(field, false)`; existence tested with `IS [NOT] MISSING`\n- [ ] No `ANY` or `EVERY ... SATISFIES` over a parameter or literal array in `WHERE`\n- [ ] `ORDER BY` with `_id` tie-breaker wherever order matters; `LIMIT` combined with `ORDER BY`\n- [ ] `GROUP BY` \u002F `HAVING` repeat expressions; empty aggregates wrapped with `ifmissing`\n- [ ] JOIN inner keys indexed (or joined on `_id`); fields qualified with aliases\n- [ ] Upserts use `ON ID CONFLICT DO UPDATE_LOCAL_DIFF`; fields removed with `UNSET`\n- [ ] `DELETE` \u002F `EVICT` by ID use `WHERE _id IN :ids`\n- [ ] Subscriptions: `SELECT *` on stable partition keys, owned by a service, registered again after every `Ditto.open()`, cancelled on logout and before evicting, not re-registered for UI filters\n- [ ] Every local query, observer, aggregate, and `JOIN` reads only documents that a subscription covers, with the same arguments\n- [ ] No empty result or count of 0 taken as proof that data does not exist; no single `execute` right after subscribing\n- [ ] Observers registered once per owner, outside render code, and released when the owner goes away (Flutter: no `onChange`; stream subscription and observer cancelled in `dispose()`)\n- [ ] Callbacks copy row values into plain data; no result or row object retained (Kotlin: `...OrNull` accessors for optional fields)\n\n## More\n\n- Reference: [reference\u002Fdql-reference.md](reference\u002Fdql-reference.md) (DQL syntax and semantics), [reference\u002Fsubscriptions-and-observers.md](reference\u002Fsubscriptions-and-observers.md) (subscription and observer APIs and lifecycle), [reference\u002Fquery-optimization.md](reference\u002Fquery-optimization.md) (result members, pagination, index-friendly predicates)\n- Examples: [examples\u002F](examples\u002F) - `.sql` for every SDK, `examples\u002F\u003Csdk>\u002F` for API code; `-good` \u002F `-bad` pairs\n- Related skills: `data-modeling` (merge semantics), `storage-lifecycle` (DELETE\u002FEVICT strategy), `performance-observability` (backpressure, indexes, logging), `transactions-attachments`, `sdk-setup` (connection problems)\n",{"name":5,"description":7},"main","b67d1a0bc891c9b2a952f8beb0a6dce7d449717c","plugins\u002Fditto\u002Fskills\u002Fquery-sync","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook","https:\u002F\u002Fdocs.ditto.live\u002Fhome\u002Fintroduction","https:\u002F\u002Fgithub.com\u002Fditto-examples","https:\u002F\u002Fdocs.ditto.live","Example Apps and Information for Ditto","2026-11-13 17:08:48",{"source":9,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add ditto-examples\u002Fditto-cookbook --skill query-sync",{"tool":54,"command":55},"bunx","bunx skills add ditto-examples\u002Fditto-cookbook --skill query-sync",{"tool":57,"command":58},"pnpm","pnpm dlx skills add ditto-examples\u002Fditto-cookbook --skill query-sync","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002FSKILL.md",true,[62,68,72,76,80,84,88,92,96,100,104,110,114,118,122,126,130,134,138,142,146,150,154,158,162,166,170,174,178,182,186,190,196,200],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"examples\u002Fdql-queries-bad.sql","OTHER","其他",4315,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fdql-queries-bad.sql",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"examples\u002Fdql-queries-good.sql",6640,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fdql-queries-good.sql",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"examples\u002Fdql-writes.sql",7277,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fdql-writes.sql",{"path":77,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":78,"sourceHtmlUrl":79},"examples\u002Fflutter\u002Fobserver-backpressure.dart",6410,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fflutter\u002Fobserver-backpressure.dart",{"path":81,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":82,"sourceHtmlUrl":83},"examples\u002Fflutter\u002Fobserver-differ.dart",5047,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fflutter\u002Fobserver-differ.dart",{"path":85,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":86,"sourceHtmlUrl":87},"examples\u002Fflutter\u002Fobserver-patterns-bad.dart",7519,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fflutter\u002Fobserver-patterns-bad.dart",{"path":89,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":90,"sourceHtmlUrl":91},"examples\u002Fflutter\u002Fobserver-patterns-good.dart",8751,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fflutter\u002Fobserver-patterns-good.dart",{"path":93,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":94,"sourceHtmlUrl":95},"examples\u002Fflutter\u002Fquery-result-handling.dart",5109,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fflutter\u002Fquery-result-handling.dart",{"path":97,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":98,"sourceHtmlUrl":99},"examples\u002Fflutter\u002Fsubscription-lifecycle-bad.dart",6258,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fflutter\u002Fsubscription-lifecycle-bad.dart",{"path":101,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":102,"sourceHtmlUrl":103},"examples\u002Fflutter\u002Fsubscription-lifecycle-good.dart",7219,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fflutter\u002Fsubscription-lifecycle-good.dart",{"path":105,"resourceType":106,"resourceTypeDesc":107,"sizeBytes":108,"sourceHtmlUrl":109},"examples\u002Fjavascript\u002Fobserver-backpressure.js","SCRIPT","脚本",4502,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fjavascript\u002Fobserver-backpressure.js",{"path":111,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":112,"sourceHtmlUrl":113},"examples\u002Fjavascript\u002Fobserver-differ.jsx",3427,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fjavascript\u002Fobserver-differ.jsx",{"path":115,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":116,"sourceHtmlUrl":117},"examples\u002Fjavascript\u002Fobserver-patterns-bad.jsx",5696,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fjavascript\u002Fobserver-patterns-bad.jsx",{"path":119,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":120,"sourceHtmlUrl":121},"examples\u002Fjavascript\u002Fobserver-patterns-good.jsx",6381,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fjavascript\u002Fobserver-patterns-good.jsx",{"path":123,"resourceType":106,"resourceTypeDesc":107,"sizeBytes":124,"sourceHtmlUrl":125},"examples\u002Fjavascript\u002Fquery-result-handling.js",4295,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fjavascript\u002Fquery-result-handling.js",{"path":127,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":128,"sourceHtmlUrl":129},"examples\u002Fjavascript\u002Fsubscription-lifecycle-bad.jsx",4300,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fjavascript\u002Fsubscription-lifecycle-bad.jsx",{"path":131,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":132,"sourceHtmlUrl":133},"examples\u002Fjavascript\u002Fsubscription-lifecycle-good.jsx",5845,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fjavascript\u002Fsubscription-lifecycle-good.jsx",{"path":135,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":136,"sourceHtmlUrl":137},"examples\u002Fkotlin\u002Fobserver-backpressure.kt",3988,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fkotlin\u002Fobserver-backpressure.kt",{"path":139,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":140,"sourceHtmlUrl":141},"examples\u002Fkotlin\u002Fobserver-differ.kt",3643,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fkotlin\u002Fobserver-differ.kt",{"path":143,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":144,"sourceHtmlUrl":145},"examples\u002Fkotlin\u002Fobserver-patterns-bad.kt",4686,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fkotlin\u002Fobserver-patterns-bad.kt",{"path":147,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":148,"sourceHtmlUrl":149},"examples\u002Fkotlin\u002Fobserver-patterns-good.kt",6642,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fkotlin\u002Fobserver-patterns-good.kt",{"path":151,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":152,"sourceHtmlUrl":153},"examples\u002Fkotlin\u002Fquery-result-handling.kt",5377,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fkotlin\u002Fquery-result-handling.kt",{"path":155,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":156,"sourceHtmlUrl":157},"examples\u002Fkotlin\u002Fsubscription-lifecycle-bad.kt",4925,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fkotlin\u002Fsubscription-lifecycle-bad.kt",{"path":159,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":160,"sourceHtmlUrl":161},"examples\u002Fkotlin\u002Fsubscription-lifecycle-good.kt",5945,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fkotlin\u002Fsubscription-lifecycle-good.kt",{"path":163,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":164,"sourceHtmlUrl":165},"examples\u002Fswift\u002Fobserver-backpressure.swift",6029,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fswift\u002Fobserver-backpressure.swift",{"path":167,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":168,"sourceHtmlUrl":169},"examples\u002Fswift\u002Fobserver-differ.swift",5728,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fswift\u002Fobserver-differ.swift",{"path":171,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":172,"sourceHtmlUrl":173},"examples\u002Fswift\u002Fobserver-patterns-bad.swift",6298,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fswift\u002Fobserver-patterns-bad.swift",{"path":175,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":176,"sourceHtmlUrl":177},"examples\u002Fswift\u002Fobserver-patterns-good.swift",8221,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fswift\u002Fobserver-patterns-good.swift",{"path":179,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":180,"sourceHtmlUrl":181},"examples\u002Fswift\u002Fquery-result-handling.swift",4719,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fswift\u002Fquery-result-handling.swift",{"path":183,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":184,"sourceHtmlUrl":185},"examples\u002Fswift\u002Fsubscription-lifecycle-bad.swift",5631,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fswift\u002Fsubscription-lifecycle-bad.swift",{"path":187,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":188,"sourceHtmlUrl":189},"examples\u002Fswift\u002Fsubscription-lifecycle-good.swift",7207,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Fexamples\u002Fswift\u002Fsubscription-lifecycle-good.swift",{"path":191,"resourceType":192,"resourceTypeDesc":193,"sizeBytes":194,"sourceHtmlUrl":195},"reference\u002Fdql-reference.md","REFERENCE","参考文档",20586,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Freference\u002Fdql-reference.md",{"path":197,"resourceType":192,"resourceTypeDesc":193,"sizeBytes":198,"sourceHtmlUrl":199},"reference\u002Fquery-optimization.md",11200,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Freference\u002Fquery-optimization.md",{"path":201,"resourceType":192,"resourceTypeDesc":193,"sizeBytes":202,"sourceHtmlUrl":203},"reference\u002Fsubscriptions-and-observers.md",26240,"https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fquery-sync\u002Freference\u002Fsubscriptions-and-observers.md",[205,221,254,279,294,310],{"skillNo":206,"name":207,"nameZh":208,"description":209,"descriptionZh":210,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":211,"categories":212,"keywords":217,"publishedAt":34},"01M6C58EAD92WQKNE74549PXEW","transactions-attachments","Ditto 事务与附件处理","Ditto SDK transactions and attachments (Flutter, JavaScript, Kotlin, Swift): ditto.store.transaction with tx.execute only, no nesting, short scopes, rollback, close(); newAttachment, ATTACHMENT declarations, lazy fetchAttachment with a stall timeout, immutability, thumbnails, and blob availability. Use when writing or reviewing ditto.store.transaction, newAttachment, or fetchAttachment code, or when displaying photos or files stored in Ditto.","Ditto SDK 的事务与附件（Flutter、JavaScript、Kotlin、Swift）：ditto.store.transaction 仅使用 tx.execute、不嵌套、作用域要短、回滚、close()；newAttachment、ATTACHMENT 声明、带停顿超时（stall timeout）的惰性 fetchAttachment、不可变性、缩略图以及 blob 可用性。适用于编写或审查 ditto.store.transaction、newAttachment 或 fetchAttachment 代码，或展示存储在 Ditto 中的照片或文件。","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Ftransactions-attachments\u002FSKILL.md",[213,214],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":215,"categoryName":216,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BS1P4QM1G70C9FKMTZ88VK","数据库管理",[218,219,220],"transactions attachments","attachments","transactions",{"skillNo":222,"name":223,"nameZh":224,"description":225,"descriptionZh":226,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":227,"categories":228,"keywords":235,"publishedAt":34},"01M6C58B0PQHV5WXMQRP9DEPX1","testing","Ditto SDK 测试策略与实现","Ditto SDK testing strategies in Flutter, JavaScript, Kotlin, or Swift: local-store test helper, tests for DQL statements, MISSING\u002FNULL filters, merge-sensitive writes, soft delete, observer lifecycle, subscription rules, and multi-peer sync tests in one process. Use when writing or reviewing tests for code that uses Ditto, setting up a Ditto test harness, or reproducing a Ditto sync or merge bug.","Flutter、JavaScript、Kotlin 或 Swift 中的 Ditto SDK 测试策略：本地存储测试辅助工具、DQL 语句测试、MISSING\u002FNULL 过滤、合并敏感写入、软删除、观察者（observer）生命周期、订阅规则，以及在单进程中运行的多节点同步测试。适用于为使用 Ditto 的代码编写或审查测试、搭建 Ditto 测试框架（test harness），或复现 Ditto 同步或合并缺陷。","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Ftesting\u002FSKILL.md",[229,232],{"categoryNo":230,"categoryName":231,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":233,"categoryName":234,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[223,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,31,253],"swift","harness","lifecycle","up","for","strategies","test harness","when","testing strategies","tests","missing","bug","writing","filters","code","delete","merge","local",{"skillNo":255,"name":256,"nameZh":257,"description":258,"descriptionZh":259,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":260,"categories":261,"keywords":264,"publishedAt":34},"01M6C587HJC1SVAPYEZHJBV1C7","storage-lifecycle","Ditto 数据删除与存储管理","Ditto SDK data removal and local storage management covering DELETE vs soft delete vs EVICT, tombstones and their TTL, husk documents, eviction with complementary subscriptions, retention cleanup, and storage monitoring. Use when writing Ditto DELETE or EVICT statements, soft-delete flags or retention cleanup for Ditto documents, or TOMBSTONE_TTL_HOURS, or when deleted Ditto data came back or evicted documents sync back.","Ditto SDK 的数据删除与本地存储管理，涵盖 DELETE、软删除与 EVICT 之间的区别、墓碑（tombstone）及其 TTL、空壳文档（husk document）、配合补充订阅的驱逐（eviction）、保留期清理以及存储监控。适用于编写 Ditto 的 DELETE 或 EVICT 语句、为 Ditto 文档设置软删除标记或保留清理、处理 TOMBSTONE_TTL_HOURS，或处理已删除的 Ditto 数据重新出现、被驱逐的文档又同步回来的情况。","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fstorage-lifecycle\u002FSKILL.md",[262,263],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":215,"categoryName":216,"taxonomyType":28,"taxonomyTypeDesc":29},[238,265,266,253,267,268,243,269,270,271,272,251,273,31,274,248,275,276,277,278],"storage","storage lifecycle","with","subscriptions","ttl","use","ditto","retention","sdk","cleanup","documents","monitoring","back","evict",{"skillNo":280,"name":281,"nameZh":282,"description":283,"descriptionZh":284,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":285,"categories":286,"keywords":291,"publishedAt":34},"01M6C5845MAD3AEBNSN3BT61WH","sdk-setup","Ditto SDK 初始化配置与安全","Ditto SDK setup, lifecycle, and production security (Flutter, JavaScript, Kotlin, Swift): DittoConfig, the authentication expiration handler, system parameters, sync start and stop, close, transports, presence, keys, permissions, revocation. Use when initializing Ditto, writing Ditto login, startup, shutdown, or background code, configuring Ditto transports, reviewing Ditto security, or when Ditto sync never starts or devices do not connect.","Ditto SDK 的设置、生命周期与生产环境安全（Flutter、JavaScript、Kotlin、Swift）：DittoConfig、认证过期处理器、系统参数、同步启动与停止、关闭、传输（transports）、在线状态（presence）、密钥、权限、撤销。适用于初始化 Ditto、编写 Ditto 登录、启动、关闭或后台代码、配置 Ditto 传输、审查 Ditto 安全，或当 Ditto 同步始终无法启动、设备无法连接时。","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fsdk-setup\u002FSKILL.md",[287,288],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":289,"categoryName":290,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C36CP2J9CRK1B6PYRXVHPN","应用配置管理",[292,293,273],"sdk setup","setup",{"skillNo":295,"name":296,"nameZh":297,"description":298,"descriptionZh":299,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":300,"categories":301,"keywords":306,"publishedAt":34},"01M6C57X4C3TQSWZJC882ECQV2","performance-observability","Ditto 观察器性能诊断","Ditto SDK store observer performance and diagnostics (Flutter, JavaScript, Kotlin, Swift): observer lifecycle, backpressure (registerObserverV2, signalNext, suspending handlers), narrow UI updates, differs, redundant writes, indexes, ADVISE, EXPLAIN, PROFILE, logging, and system: collections. Use when a Ditto query is slow, a screen showing Ditto data janks, Ditto observers grow memory, Ditto upserts repeat, or when setting up Ditto logging.","Ditto SDK 存储观察器的性能与诊断（Flutter、JavaScript、Kotlin、Swift）：观察器生命周期、背压（registerObserverV2、signalNext、挂起处理器）、精细 UI 更新、差异比较（differs）、冗余写入、索引、ADVISE、EXPLAIN、PROFILE、日志记录，以及 system: 集合。当 Ditto 查询缓慢、显示 Ditto 数据的界面卡顿、Ditto 观察器内存增长、Ditto upsert 重复执行，或需要设置 Ditto 日志记录时使用。","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fperformance-observability\u002FSKILL.md",[302,303],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":304,"categoryName":305,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C796JZ1YCTM2B2X7TKEWZZ","性能剖析与优化",[307,308,309],"performance observability","performance","observability",{"skillNo":311,"name":312,"nameZh":313,"description":314,"descriptionZh":315,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":316,"categories":317,"keywords":322,"publishedAt":34},"01M6C57V1EZKA9B5W1G4F00HAH","guide","Ditto SDK 最佳实践指南检索","Searches the complete Ditto SDK best practices guide (SDK 5.2.0, Flutter, JavaScript, Kotlin, Swift) bundled with this plugin, for answers the focused ditto skills do not cover. Use to look up a Ditto API, DQL keyword or function, system parameter, error message, an SDK's API or behavior, or the reasoning behind a rule, or when a Ditto question spans several topics.","搜索本插件内置的完整 Ditto SDK 最佳实践指南（SDK 5.2.0，Flutter、JavaScript、Kotlin、Swift），以获取专项 Ditto 技能未覆盖的答案。可用于查询 Ditto API、DQL 关键字或函数、系统参数、错误消息、某个 SDK 的 API 或行为、某条规则背后的原理，或处理跨越多个主题的 Ditto 问题。","https:\u002F\u002Fgithub.com\u002Fditto-examples\u002Fditto-cookbook\u002Fblob\u002Fmain\u002Fplugins\u002Fditto\u002Fskills\u002Fguide\u002FSKILL.md",[318,321],{"categoryNo":319,"categoryName":320,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQ6TKQDF2K4KQS863Q79P4","开发参考",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[312,323,324,325,239,326,270,327,328,267,329,330,331,332,240,271,333,243,334,335],"kotlin","plugin","system","question","best practices","api","error","do","message","complete","flutter","javascript","topics"]