Build SQLite-backed reactive UI in `apps/desktop` using stable patterns for reads, selection, forms, writes, and loading states. Use when implementing or reviewing screens built on `useDrizzleLiveQuery` and SQLite mutations.
Use SQLite live queries as the screen data source without duplicating subscriptions, fighting the reactivity model, or making selection and form state unstable.
const items = useItems();
const selectedItem = items.find((item) => item.id === selectedId) ?? null;
This is the main anti-flicker pattern.
useDrizzleLiveQuery(db.select()...)db.insert, db.update, db.delete inside useMutationDo not add manual invalidation unless the write affects data outside the subscribed query graph.
id and immediately subscribe againundefined during normal selection changes