CupertinoDataEngine

June 8, 2026 ยท View on GitHub

Read-only embedded engine facade for Cupertino clients.

CupertinoDataEngine owns the app-facing boundary over a local Cupertino corpus. It depends on CupertinoDataKit for protocol and value-type contracts, validates configured corpus resources, and returns protocol-typed readers. UI clients receive readers or backend adapters, not database handles or concrete storage types.

Opening A Corpus

App clients should open a downloaded or bundled corpus through one opaque handle:

let engine = try await CupertinoDataEngine(corpus: .current(at: corpusDirectory))

The handle names the corpus directory only. The engine owns the current file layout, schema validation, and read-only SQLite reader construction.

Read Surface

CupertinoDataEngine conforms to Search.Database and Search.DocumentBrowsing. When multiple source corpora are configured, the engine fans out free-text, document, framework, symbol, inheritance, availability, and resource-list calls through the injected source readers. Package search is included in unified search when a package reader is configured.

The engine validates corpus files and owns reader lifecycle. Concrete SQLite readers are constructed inside this package; desktop and mobile clients depend on the protocol surface and do not handle DB paths or storage objects.

Verification

Run the iOS build proof before changing the embedded engine closure:

./scripts/check-ios-build.sh

The script builds CupertinoDataEngine for both generic iOS Simulator and generic iOS device destinations through Xcode.