Skip to content

0.9.0 — release candidate for 1.0.0

Pre-release
Pre-release

Choose a tag to compare

@ThorFuchs ThorFuchs released this 15 Nov 09:10
· 27 commits to main since this release
b8f27c3

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

  • SQLitePredicate is 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.isStop is renamed isInterruption.

Added

  • Opt-in model layer, two new products (design and evidence:
    Documentation/MODEL-ARCHITECTURE.md):
    • SQLiteSwiftModels: SQLiteRecord with SQLiteRecordDescriptor and typed
      SQLiteColumns; strict SQLiteCodecs (text, BLOB, integer, Int, Bool, REAL,
      decimal text, UUID as text or BLOB, timestamp, Unix milliseconds, optional,
      raw-value enums); SQLiteRecordSnapshot with SQLiteRecordVersion (revision
      plus a random incarnation, so a reused key never matches an old version);
      fetch, fetchAll and verifySchema; conditional insert, update,
      save(_:expecting:) and delete returning SQLiteRecordWriteOutcome
      (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 in resyncRequired); SQLiteModelSchema for the store's tables.
    • SQLiteSwiftModelContext: main-actor SQLiteModelContext with one
      @Observable SQLiteModel handle per record (clean, dirty, saving,
      conflicted, deleted, indeterminate), atomic conditional save(), explicit
      useRemote, keepLocal and discard, resolveIndeterminate() for unknown
      commit outcomes, observeChanges() for live handles, and SQLiteLiveQuery.
    • DocC catalogs and guides for both; Scripts/build-docs.sh builds every module.
  • SQLiteError.Code.schemaMismatch and .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.yml for 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_v2 raced (found by ThreadSanitizer on Linux).
  • Internal locks use pthread_mutex_t, which ThreadSanitizer sees on every platform,
    instead of Synchronization.Mutex, whose Linux futex lock it cannot see.
  • Tests: the concurrency gauge uses SQLiteLocked instead of Mutex, 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.