Skip to content
CAI
Software that uses CAICheck a score

pointfreeco/sqlite-data

59.7

Adequate · 1 October 2026

19.9k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

SQLiteData is a Swift library that provides declarative property wrappers for observing and querying SQLite databases within SwiftUI applications. It integrates with CloudKit to enable synchronization and sharing of local database records across devices. The system supports advanced features such as sectioned data fetching, custom SQL functions, and comprehensive testing utilities for both database queries and sync logic.

Features

Add Tagged trait for identifier string conversion

A new \Tagged\ trait has been added to the SQLiteData library, providing an extension for the \Tagged\ type to conform to \IdentifierStringConvertible\. This allows tagged identifiers to be seamlessly converted to and from their raw string representations, facilitating their use within the data layer's identifier system.

Sources/SQLiteData/Traits · high confidence

Add test-local configuration variables for database and CloudKit integration

Introduced a new \TestLocals.swift\ file that defines several \@TaskLocal\ variables to control test behavior for database preparation, immediate execution, metadata attachment, and CloudKit account status. These variables allow tests to inject specific configurations for \UserDatabase\ operations and CloudKit sync engine delegates, facilitating more granular control over test environments.

Sources/TestLocals · high confidence

CloudKitDemo example app added with CloudKit sharing support

A new CloudKitDemo example application has been added to the Examples directory, demonstrating how to integrate SQLiteData with CloudKit for data synchronization and sharing. The app features a counter list that can be shared via CloudKit, with UI support for viewing shared versus private records, and handles CloudKit share acceptance through the app delegate and scene delegate. It includes the necessary entitlements for iCloud services and background remote notifications, along with a database schema and sync engine configuration.

Examples/CloudKitDemo · high confidence

Introduce @Fetch, @FetchAll, and @FetchOne property wrappers for SQLite data observation

The library now provides a new set of property wrappers—@Fetch, @FetchAll, and @FetchOne—to declaratively query and observe SQLite data. These wrappers integrate with the Sharing package to manage shared readers and automatically handle database observation lifecycles, including optional SwiftUI state boxing and cancellation via FetchSubscription. @FetchAll specifically supports non-optional sectioning via a sectionBy parameter, allowing results to be grouped into named sections for UI rendering, while @FetchOne automatically observes primary-keyed records.

Sources/SQLiteData · high confidence

Introduce CloudKit synchronization and sharing capabilities

Adds a new \SyncEngine\ to synchronize local SQLite tables with CloudKit, including support for sharing records via \CKShare\ and a \CloudSharingView\ for presenting share URLs. The engine requires tables to use UUID primary keys (with a \migratePrimaryKeys\ tool to convert integer keys) and enforces that only root records (those without foreign keys) and non-private tables are shareable. It also provides customizable logout behavior through a \SyncEngineDelegate\ and integrates with the dependency injection system for easy configuration.

Sources/SQLiteData/CloudKit · high confidence

Introduce internal CloudKit synchronization infrastructure

This change adds the internal implementation layer for CloudKit synchronization, introducing protocols and abstractions for CloudKit containers and databases (CloudContainer, CloudDatabase) to decouple the sync engine from Apple's native CloudKit types. It includes a metadatabase schema for tracking record state, sharing metadata, and pending changes, along with a comprehensive mock implementation (MockCloudContainer, MockCloudDatabase, MockSyncEngine) to enable testing of sync logic without a live CloudKit connection. The diff also adds support for logging sync events using TabularData and dependency injection for time and notification center to improve testability.

Sources/SQLiteData/CloudKit/Internal · high confidence

New GRDB integration layer for SQLiteData

This change introduces the \Sources/SQLiteData/StructuredQueries+GRDB\ module, providing the concrete GRDB-backed implementation for the SQLiteData library. It adds support for user-defined collations (including a new \CanonicalCollation\ for Unicode Canonical Equivalence) and user-defined scalar and aggregate functions. The integration also enables sectioned fetching via \fetchAll(sectionBy:)\, static \fetch\ and \find\ helpers on tables, and a \seed\ method for initializing database state. Additionally, it improves UUID decoding to handle raw UTF-8 bytes and refactors the default database provisioning to better support live, preview, and test contexts.

Sources/SQLiteData/StructuredQueries+GRDB · high confidence

New assertQuery snapshot testing helper for database content

A new \assertQuery\ function has been added to the SQLiteDataTestSupport module, providing an end-to-end snapshot testing helper for database queries. This utility allows developers to generate and verify snapshots of both the SQL fragment produced by a statement and the decoded results, supporting optional SQL inclusion and custom database writers via the Dependencies system.

Sources/SQLiteDataTestSupport · high confidence

Removals

Removal of SharingGRDB module

The SharingGRDB library has been removed from the codebase. This eliminates the ability to use the \@SharedReader\ property wrapper with GRDB database queries, including the \fetch\, \fetchAll\, and \fetchOne\ methods that previously allowed observing SQLite data changes in SwiftUI applications.

Sources/SharingGRDB · high confidence

Removed SharingGRDB workspace file

The SharingGRDB.xcworkspace file has been deleted, removing the workspace configuration that previously referenced the Examples project. This change eliminates the shared workspace setup for the SharingGRDB component.

SharingGRDB.xcworkspace · high confidence

Behavioural changes

Internal refactoring for SwiftUI integration and database management

This change introduces several internal components to support better SwiftUI state management and database handling. It adds \FetchBox\ and \FetchKey\ to wrap fetch operations in SwiftUI's \@State\ and \SharedReader\ for efficient reactivity, including an \AnimatedScheduler\ for optional animations. It also implements \TemporaryDatabase\ to nest temporary SQLite files in a dedicated directory, \StatementKey\ to compute hashability from SQL fragments, and \ISO8601\ extensions for robust date formatting. Finally, \Exports.swift\ centralizes internal imports for dependencies like GRDB and Dependencies.

Sources/SQLiteData/Internal · high confidence

Library renamed to SQLiteData with updated platform requirements and dependencies

The library has been renamed from SharingGRDB to SQLiteData, reflecting its broader capabilities beyond just sharing. This change includes raising the minimum supported platform versions to iOS 16, macOS 13, tvOS 16, and watchOS 9. The package now depends on GRDB.swift 7.6.0 and introduces several new dependencies including swift-collections, swift-concurrency-extras, swift-custom-dump, swift-snapshot-testing, swift-structured-queries, and xctest-dynamic-overlay. The product name in Package.swift has been updated to SQLiteData, and the documentation target has been changed from SharingGRDB to SQLiteData.

(repo-wide) · high confidence

Migrate case studies from SharingGRDB to SQLiteData

The case study examples have been updated to use the new SQLiteData library instead of SharingGRDB. This migration replaces the \@SharedReader\ macro with \@Fetch\, \@FetchAll\, and \@FetchOne\, and switches record definitions from GRDB's \FetchableRecord\/\MutablePersistableRecord\ protocols to the \@Table\ macro. Database operations now use the new \insert\, \delete\, and \where\ builder syntax instead of direct GRDB methods, and table migrations utilize the \\#sql\ macro for SQL string execution.

Examples/CaseStudies · high confidence

Modernize example projects with new targets and updated dependencies

The Examples workspace has been modernized to support new demonstration applications and updated tooling. New targets for CloudKitDemo and Integration have been added, alongside test targets for Reminders and SyncUps. The project references have been updated to replace the SharingGRDB dependency with SQLiteData, CasePaths, and snapshot testing libraries (InlineSnapshotTesting, SnapshotTestingCustomDump). Scheme files for CaseStudies, Reminders, and SyncUps have been upgraded to Xcode 14.3 (version 2610), and the SyncUps scheme now explicitly includes its test target in the test action.

Examples/Examples.xcodeproj · high confidence

Reminders demo app migrated to SQLiteData with CloudKit sharing support

The Reminders example app has been completely rewritten to use the new SQLiteData library, replacing the previous SharingGRDB implementation. This migration introduces native CloudKit synchronization and sharing capabilities, evidenced by the new entitlements, Info.plist configuration, and SyncEngine integration in the app delegate. The UI layer has been modernized to use SwiftUI's @Observable and @Fetch\* property wrappers for reactive database observations, and the app now supports customizable list ordering, manual drag-and-drop sorting, and a new 'Top Tags' feature that highlights frequently used tags.

Examples/Reminders · high confidence

SyncUps demo migrates from SharingGRDB to SQLiteData

The SyncUps example app has been updated to use the SQLiteData persistence library instead of SharingGRDB. This migration replaces the previous GRDB-based schema and migration logic with SQLiteData's declarative \@Table\ models and SQL-based migrations, switching primary keys from auto-incrementing integers to UUIDs. The app now uses SQLiteData's \@FetchAll\ and \@FetchOne\ property wrappers for data fetching, updates the database initialization to use a \bootstrapDatabase\ dependency, and adds a debug-only tip to seed sample data for easier testing.

Examples/SyncUps · high confidence

Test coverage

Added blank line in CaseStudiesTests.swift; Added comprehensive test suite for Reminders demo app; Added comprehensive test suite for SQLiteData core features; Added internal test infrastructure for CloudKit synchronization; Added tests for SyncUp form creation and updates; Expanded test coverage for CloudKit sync engine lifecycle and data handling; Removed GRDB integration test suite.

Dependencies

Library rebranded to SQLiteData with Swift 6.4 and major dependency upgrades

The library has been renamed from SharingGRDB to SQLiteData, raising the minimum platform requirements to iOS 16, macOS 13, tvOS 16, and watchOS 9, and switching the Swift language mode to 6.4. This update upgrades core dependencies including GRDB.swift to 7.11.1, swift-dependencies to 1.17.1, swift-sharing to 2.10.1, and swift-structured-queries to 0.39.1, while introducing new optional traits for CasePaths, ColumnCoding, and StrictDecoding to customize table and selection behavior.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 59 → 60 (+0.9)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 90 → 90 (-0.4)
  • Architecture 99 → 100 (+0.5)
  • Maturity 65 → 64 (-0.2)
  • Readiness 52 → 54 (+1.9)
  • Security 57 → 57 (+0.0)
  • Domain Modelling 64 → 64 (+0.0)

Resolved (3)

  • Duplicated block (8–9 lines × 2) (Sources/SQLiteData/CloudKit/Internal/UnsyncedRecordID.swift)
  • Hotspot: Sources/SQLiteData/StructuredQueries+GRDB/CustomFunctions.swift (Sources/SQLiteData/StructuredQueries+GRDB/CustomFunctions.swift)
  • Off-boarding risk: anonymized user #1

New (24)

  • Coverage not measured — Swift suite
  • Dependency not covered by the committed resolution: swift-tagged
  • Duplicated block (10 lines × 2) (Examples/Integration/Regression Coverage/ParentRerenderCancellation.swift)
  • Duplicated block (14–15 lines × 2) (Examples/Reminders/TagsForm.swift)
  • Duplicated block (15–16 lines × 2) (Sources/SQLiteDataTestSupport/AssertQuery.swift)
  • Duplicated block (17 lines × 9) (Examples/CaseStudies/Animations.swift)
  • Duplicated block (21 lines × 4) (Examples/CaseStudies/Animations.swift)
  • Duplicated block (23 lines × 3) (Examples/Integration/Regression Coverage/ChildIdentityReset.swift)
  • Duplicated block (24 lines × 2) (Examples/Integration/Regression Coverage/ChildIdentityReset.swift)
  • Duplicated block (6 lines × 2) (Sources/SQLiteData/Fetch.swift)
  • Duplicated block (7 lines × 2) (Examples/Reminders/RemindersLists.swift)
  • Duplicated block (7 lines × 2) (Sources/SQLiteData/CloudKit/SyncEngine.swift)
  • Duplicated block (8 lines × 2) (Examples/Integration/Regression Coverage/ParentRerenderLoadError.swift)
  • Duplicated block (8–9 lines × 2) (Sources/SQLiteData/CloudKit/Internal/UnsyncedRecordID.swift)
  • Inconsistent initialization patterns for Fetch vs FetchOne/FetchAll. Fetch uses a specific FetchKeyRequest type in its constructor, while FetchOne and FetchAll accept generic S or some Statement<V> types directly. This creates a fragmented API surface where the same logical operation (initializing a fetch with a query) has different type constraints and parameter names across similar types.
  • Inconsistent method signatures for loading data. Fetch.load expects a FetchKeyRequest, while FetchOne and FetchAll accept generic S or Statement types. Furthermore, FetchOne has two distinct overloads for Statement<V> and Statement<Value>, which is confusing and likely redundant if V and Value are related or if the distinction is not semantically clear to the user.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) (Examples/CaseStudies/Animations.swift)
  • No assertions: previewSyncEngine (Tests/SQLiteDataTests/CloudKitTests/SyncEngineTests.swift)
  • No assertions: testSyncEngine (Tests/SQLiteDataTests/CloudKitTests/SyncEngineTests.swift)
  • Off-boarding risk: anonymized user #1
  • …and 4 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

pointfreeco/sqlite-data was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 6390b5c076764c74713a3fd4ebcc3b61b2220dda — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.