Repository navigation
0.9.0 — release candidate for 1.0.0
Pre-release
Pre-release
Release candidate for 1.0.0: the API is frozen. Includes the opt-in model layer (SQLiteSwiftModels, SQLiteSwiftModelContext). Install with .upToNextMinor(from: "0.9.0"); 1.0.0 follows once 0.9.0 is validated downstream without API changes.
Breaking changes
SQLitePredicateis a struct instead of an enum, so operators can be added in 1.x.
Predicates are built with the same spellings (.equals,.notIn,.and, …);
only code that pattern-matched on predicate cases changes.SQLiteError.isStopis renamedisInterruption.
Added
- Opt-in model layer, two new products (design and evidence:
Documentation/MODEL-ARCHITECTURE.md):SQLiteSwiftModels:SQLiteRecordwithSQLiteRecordDescriptorand typed
SQLiteColumns; strictSQLiteCodecs (text, BLOB, integer, Int, Bool, REAL,
decimal text, UUID as text or BLOB, timestamp, Unix milliseconds, optional,
raw-value enums);SQLiteRecordSnapshotwithSQLiteRecordVersion(revision
plus a random incarnation, so a reused key never matches an old version);
fetch,fetchAllandverifySchema; conditionalinsert,update,
save(_:expecting:)anddeletereturningSQLiteRecordWriteOutcome
(inserted,updated,deleted,conflict(current:),missing);
all-or-nothing batches (SQLiteDatabase.writeRecords(_:));SQLiteModelStore
with a committed-change stream (snapshot handoff without gaps, bounded buffers
ending inresyncRequired);SQLiteModelSchemafor the store's tables.SQLiteSwiftModelContext: main-actorSQLiteModelContextwith one
@ObservableSQLiteModelhandle per record (clean,dirty,saving,
conflicted,deleted,indeterminate), atomic conditionalsave(), explicit
useRemote,keepLocalanddiscard,resolveIndeterminate()for unknown
commit outcomes,observeChanges()for live handles, andSQLiteLiveQuery.- DocC catalogs and guides for both;
Scripts/build-docs.shbuilds every module.
SQLiteError.Code.schemaMismatchand.invalidStoredValue(with
SQLiteError.column), used by the model layer.SQLiteSynchronous.extra(PRAGMA synchronous=EXTRA).- Community files: SECURITY.md (private vulnerability reporting), CONTRIBUTING.md,
CODE_OF_CONDUCT.md, issue forms, a pull request template, CODEOWNERS. - CI: Thread Sanitizer on macOS and Linux, Address Sanitizer on Linux, an API-breakage
check against the latest release (Scripts/check-api.sh), a GitHub-hosted macOS
job so pull requests from forks get macOS coverage, and Dependabot for GitHub
Actions. .spi.ymlfor the Swift Package Index (documentation for every product).- README for public use, with the versioning policy.
Fixed
- SQLite is initialized once (
sqlite3_initialize()) before connections open on
several threads at the same time; SQLite's implicit initialization inside
sqlite3_open_v2raced (found by ThreadSanitizer on Linux). - Internal locks use
pthread_mutex_t, which ThreadSanitizer sees on every platform,
instead ofSynchronization.Mutex, whose Linux futex lock it cannot see. - Tests: the concurrency gauge uses
SQLiteLockedinstead ofMutex, which
ThreadSanitizer on Linux reported as a race under contention. - CI: Linux ThreadSanitizer runs with ASLR disabled; the one remaining known-benign
SQLite report and the XCTest runner's exit-time leaks are suppressed with reasons.
Changed
- Enums that will never gain cases say so in their documentation.
- The 0.1.0 acceptance record moved to
Documentation/Acceptance-0.1.0.md.