stephencelis/SQLite.swift
68.6
Adequate · 27 September 2026
8.1k
lines of production code
Swift
primary language
4
measurements over time
What this system is
This system is a Swift library that provides a type-safe, modern interface for interacting with SQLite databases on Apple platforms. It enables developers to construct queries using a typed expression API, manage database schemas programmatically, and integrate with extensions like SQLCipher, FTS5, and RTree. The library also supports storing Foundation types directly in the database and handles cross-platform builds via Swift Package Manager and CocoaPods.
How it got here
2014 — Legacy cleanup and modernization
8 changes.
The project removed the legacy SQLite Common module and associated test suites, replacing them with a modernized API and updated playground examples. Build infrastructure was refactored to support universal Apple platforms and integrated SwiftLint for automated code quality enforcement.
2015–2016 — Swift Package Manager integration and API expansion
6 changes.
This period focused on modernizing the project's distribution by adding Swift Package Manager and CocoaPods support, alongside a comprehensive expansion of the API. New features included a type-safe query builder, support for Foundation types, and dedicated extensions for SQLCipher, FTS5, and RTree, all accompanied by updated test infrastructure.
2021–2026 — Schema API and test expansion
8 changes.
This period focused on introducing a new schema introspection and migration API for SQLite, enabling programmatic inspection and alteration of database structures. It also involved significantly expanding test coverage across core components, extensions, and the typed query builder, while adding support for visionOS and various build systems like SPM and Tuist.
Features
Added Foundation type support and privacy manifest
The library now supports storing and retrieving Foundation types including Data, Date, UUID, and URL directly in SQLite databases via new Value conformances in Sources/SQLite/Foundation.swift. A privacy manifest (PrivacyInfo.xcprivacy) has been added to comply with Apple's data usage requirements, and the project structure has been reorganized to support Swift packages.
Sources/SQLite · high confidence
Added Xcode schemes for macOS, iOS, tvOS, watchOS, and visionOS
The project now includes shared Xcode schemes for all supported Apple platforms (macOS, iOS, tvOS, watchOS, and visionOS). These schemes configure the build, test, launch, profile, analyze, and archive actions for each platform's target, enabling developers to easily run and test the SQLite framework on each specific platform directly within Xcode.
SQLite.xcodeproj/xcshareddata · high confidence
New SQLCipher, FTS5, and RTree extension support
The library now includes dedicated Swift extensions for SQLCipher, FTS5, and RTree. The new Cipher extension provides methods to set encryption keys, migrate databases between SQLCipher major versions, rekey, export encrypted databases, and manage logging. FTS5 support is added via a new FTS5Config class that allows configuring detail levels and column sizes, while the existing FTS4 extension gains a trigram tokenizer. Additionally, an RTree extension is introduced to create spatial index virtual tables.
Sources/SQLite/Extensions · high confidence
New database backup, custom aggregation, and WAL management capabilities
The library now supports database backup operations via a new \Backup\ class that wraps SQLite's backup API, allowing users to copy data between connections. It introduces \Connection.createAggregation\ to define custom SQL aggregate functions, and adds \Connection.attach\/\detach\ for managing attached databases. Users can also configure Write-Ahead Logging (WAL) via \journalMode\ and \enableWAL\, and access the \userVersion\ and \sqliteVersion\ properties for database metadata.
Sources/SQLite/Core · high confidence
New schema introspection and migration API for SQLite
This change introduces a new \Schema\ module within the SQLite library, providing \SchemaReader\ and \SchemaChanger\ classes to inspect and modify database structures programmatically. Users can now read table definitions, column affinities, indexes, and foreign keys via \SchemaReader\, and perform schema alterations such as adding/dropping columns, renaming tables, and managing indexes via \SchemaChanger\. The implementation handles SQLite version compatibility (e.g., using \ALTER TABLE ... RENAME COLUMN\ where supported) and includes helper methods on \Connection\ for integrity and foreign key checks.
Sources/SQLite/Schema · high confidence
New typed SQL expression API and query builder
The \Sources/SQLite/Typed\ module introduces a new type-safe query builder and expression system. This includes the \Expression\ and \QueryType\ protocols for constructing SQL statements, along with dedicated files for aggregate functions (\AggregateFunctions\), core SQL functions (\CoreFunctions\), date/time functions (\DateAndTimeFunctions\), and custom functions (\CustomFunctions\). The update also adds support for \WITH\ clauses (\Query+with\), \Collation\ handling, and \Codable\ integration for encoding/decoding objects to and from database rows (\Coding\).
Sources/SQLite/Typed · high confidence
Removals
Removal of legacy SQLite Common module
The legacy SQLite Common module, which provided the foundational Database, Statement, and Datatype classes for interacting with SQLite, has been removed. This deletion eliminates the previous low-level API surface, including the Datatype protocol and its standard type extensions, as well as the C bridging header and build configuration files that supported this older implementation.
SQLite Common · high confidence
Removal of legacy SQLite test suite
The legacy SQLite test suite, including \DatabaseTests.swift\, \StatementTests.swift\, and \TestHelper.swift\, has been removed. This deletion eliminates the previous test coverage for database operations such as statement preparation, parameter binding, scalar queries, transactions, and savepoints, indicating a shift away from the older testing infrastructure.
SQLite Common Tests · high confidence
Behavioural changes
Removal of legacy Mac and iOS framework headers and Info.plist
The project has removed the specific \SQLite Mac.h\ and \SQLite iOS.h\ umbrella headers, along with the \Info.plist\ for the iOS target. This cleanup eliminates the separate, platform-specific framework wrapper files, aligning with the move toward a universal framework structure where these legacy definitions are no longer required.
SQLite Mac, SQLite iOS · high confidence
Removed Info.plist from SQLite iOS Tests
The Info.plist file for the SQLite iOS Tests target has been deleted. This change removes the explicit bundle configuration (such as bundle identifier and version strings) from the test target, likely relying on default Xcode build settings or a unified project configuration instead.
SQLite iOS Tests · high confidence
SQLite playground updated to modern Swift and macOS
The SQLite.playground has been completely rewritten for modern Swift (replacing legacy \println\ and \Database\ APIs with \print\ and \Connection\) and migrated from an iOS simulator target to macOS. The new example demonstrates current library features including the \RowIterator\ API, FTS5 virtual tables, custom aggregations, and schema alterations via \SchemaChanger\, while removing the previous multi-file structure and HTML documentation fragments.
SQLite.playground · high confidence
Xcode project configuration updated for modern build settings and module maps
The Xcode project configuration has been updated to use a single module map file for the sqlite3 shim and to reference the version-independent \libsqlite3.tbd\ framework on macOS, ensuring compatibility with newer Xcode versions and simplifying the build process.
SQLite.xcodeproj · medium confidence
Test coverage
Add SwiftLint configuration and automated linting targets; Added SPM integration test for SQLite access; Added SwiftLint configuration and visionOS test plan; Added Tuist-based test project for SQLite integration; Added comprehensive test coverage for SQLite core components; Added comprehensive test coverage for the typed SQL query builder; Added test coverage for SQLite extensions (Cipher, FTS4, FTS5, RTree); Added test coverage for SQLite schema operations; Added test infrastructure and coverage for Foundation types.
Dependencies
Initial release of SQLite.swift 0.16.0 with Swift Package Manager and CocoaPods support
This change introduces the initial package manifests for SQLite.swift version 0.16.0, enabling installation via Swift Package Manager (Package.swift) and CocoaPods (SQLite.swift.podspec). The Swift package defines support for iOS 12, macOS 10.13, watchOS 4, tvOS 12, and visionOS 1, and includes traits to select between system SQLite, embedded CSQLite, or SQLCipher encryption. The CocoaPods spec mirrors these capabilities with 'standard', 'standalone', and 'SQLCipher' subspecs, while a Gemfile adds the cocoapods dependency for development.
(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
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 47 → 69 (+22.0)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 98 (-2.0)
- Architecture 94 (new)
- Maturity 55 → 62 (+6.7)
- Readiness 27 → 62 (+34.6)
- Security 65 → 80 (+15.2)
Resolved (10)
- Dimension evaluation failed
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- No automated tests
- No exposed public API
- No tests found
- Test reliability not included
- The Usage example is cut mid-sentence ('try db.run(users.create { t in ...') before showing how to install via CocoaPods or Carthage. (README.md)
New (218)
- Duplicate intent. 'filter' and 'where' perform the exact same operation (adding a WHERE clause) but have different names. This creates two ways to do the same thing, which is a common source of confusion for API users.
- Duplicated block (5 lines × 2) (Sources/SQLite/Typed/CoreFunctions.swift)
- Duplicated block (5 lines × 2) (Sources/SQLite/Typed/Query.swift)
- Duplicated block (8–9 lines × 2) (Sources/SQLite/Typed/WindowFunctions.swift)
- Further orphaned files (smaller)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Inconsistent backup API design. 'Connection.backup' returns a 'Backup' object, but the 'Backup' type also has a public initializer. Users can either use the convenience method on Connection or manually instantiate Backup and call step/finish. This exposes internal implementation details (the step/finish lifecycle) that should likely be encapsulated within the Connection method or a higher-level abstraction.
- Inconsistent naming and return types for query preparation. 'prepare' is overloaded with different signatures returning different types (Statement vs AnySequence), and there is a separate 'prepareRowIterator' method. This creates ambiguity about whether 'prepare' returns a reusable statement object or an immediate iterator.
- Low cohesion: FTS4Config (LCOM4 6) (Sources/SQLite/Extensions/FTS4.swift)
- Low cohesion: FTS5Config (LCOM4 5) (Sources/SQLite/Extensions/FTS5.swift)
- Low cohesion: SQLiteKeyedEncodingContainer (LCOM4 5) (Sources/SQLite/Typed/Coding.swift)
- Low cohesion: String (LCOM4 4) (Sources/SQLite/Helpers.swift)
- Low coverage: Sources/SQLite/Core/Connection+Aggregation.swift (Sources/SQLite/Core/Connection+Aggregation.swift)
- Low coverage: Sources/SQLite/Core/Errors.swift (Sources/SQLite/Core/Errors.swift)
- Low coverage: Sources/SQLite/Core/SQLiteVersion.swift (Sources/SQLite/Core/SQLiteVersion.swift)
- …and 198 more
Changes since last survey
- 15 commits — 7 feature/other, 8 fixes
By area
- (repo) — 6 commits
- (root) — 3 commits
- .github/workflows — 3 commits
- Sources/SQLite — 2 commits
- Tests/SQLiteTests — 1 commit
Notable commits
- fix: Fix watchOS minimum deployment target for Xcode 27 compatibility
- fix: Fix watchOS minimum deployment target for Xcode 27 compatibility
- fix: Merge pull request #1367 from ShiroKSH/fix/release-rolled-back-savepoints
- fix: Merge pull request #1371 from vjymisal0/fix-column-check-constraint-parens
- fix: Merge pull request #1373 from vjymisal0/codex/close-v2-deinit-fix
- fix: Merge pull request #1377 from skyfoxa/fix/watchos-v9-minimum
- fix: Wrap range/BETWEEN expressions in parens to fix invalid CHECK SQL
- fix: fix(core): avoid crash on connection deinit via sqlite3_close_v2
- change: Disable macos-15
- change: Merge pull request #1368 from colemancda/android-exclude-privacy-resource
- change: Merge pull request #1374 from stephencelis/update-bundle
- change: Update bundle
- change: ci: resolve Tuist package before installation
- change: ci: use SwiftPM fallback for Tuist
- change: style: keep connection within lint limit
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
stephencelis/SQLite.swift 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 27 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 989fa8d73c2f574ee3e7b5d68e432d94c81ee945 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-d00c643c3f66.