Skip to content

feat: expose Reminders sections in output#25

Open
maciej wants to merge 1 commit intosteipete:mainfrom
maciej:issue-14
Open

feat: expose Reminders sections in output#25
maciej wants to merge 1 commit intosteipete:mainfrom
maciej:issue-14

Conversation

@maciej
Copy link

@maciej maciej commented Feb 6, 2026

Summary

Closes #14.

  • Add read-only support for Apple Reminders sections (custom groupings within a list) by reading the Reminders CoreData SQLite store directly, since EventKit does not expose section data.
  • Surface sectionName as an optional field on ReminderItem — appears in JSON, plain, and standard output formats (e.g. [Books/Non-fiction]).
  • Refactor EventKitStore to use a shared item(from:) helper, removing four duplicate ReminderItem construction sites.

Details

SectionResolver opens the Reminders SQLite database read-only and joins three tables (ZREMCDBASESECTION, ZREMCDREMINDER, ZREMCDBASELIST) to build an EventKit calendarItemIdentifier → section display name map. It degrades gracefully to an empty map when the database is unavailable or unreadable.

🤖 Generated with Claude Code

Read section names from the Reminders CoreData SQLite store and surface
them on ReminderItem as an optional sectionName field. Sections appear
in standard output as [List/Section], in plain output as an extra column,
and in JSON output as a top-level key.

Implementation approach:
- Add SectionResolver that opens the Reminders SQLite database read-only
  and joins three tables (ZREMCDBASESECTION, ZREMCDREMINDER,
  ZREMCDBASELIST) to build an EventKit ID → section-name map. Degrades
  gracefully to an empty map when the database is unavailable.
- Add sectionName: String? to ReminderItem.
- Link sqlite3 in Package.swift.
- Refactor EventKitStore to use a shared item(from:) helper, eliminating
  four duplicate ReminderItem construction sites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wgj
Copy link

wgj commented Feb 9, 2026

Thanks for putting this together, @maciej. The read‑only approach and graceful fallback are solid. A few suggestions, mostly nits:

findDatabase() returns the first readable .sqlite, but there can be multiple Data-.sqlite files. It would be more reliable to choose the most recently modified Data-.sqlite (or follow whatever store pointer exists), otherwise you can end up reading a stale store and missing/incorrect section mappings.

CK identifiers can be null/empty depending on sync state. Guarding against null CK IDs would avoid accidental empty map entries.

Section ordering isn’t accounted for (ZSECTIONIDSORDERINGASDATA). If the goal is only to annotate reminders with section names, that’s fine, but it might be worth calling out in docs or leaving room to incorporate ordering later.

Consider sqlite busy timeout or read-only options that handle WAL/lock contention a bit more gracefully. Not critical, but reduces intermittent failures.

Happy to help iterate if you want a quick follow‑up patch. Some of these nits are unique to how I use Reminders.app. I use the Columns view, and have Kanban-style sections, such that ordering and frequent section changes and CloudKit syncs are relevant use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose Reminders 'Sections' (custom sections within a list) in JSON/plain output

2 participants