Skip to content

Releases

1.1.0

Choose a tag to compare

@ThorFuchs ThorFuchs released this 16 Nov 10:30
3a9eba0

Operate it on a server. Everything is additive: Scripts/check-api.sh against 1.0.0
reports no breaking change, defaults are unchanged, and without a package trait the
dependency graph is still empty. Upgrading from 1.0.0 needs no code change.

Added

  • Backups and maintenance: backup(to:pagesPerStep:limits:progress:) copies the
    database from one read snapshot with sqlite3_backup, in steps that honor
    deadlines and cancellation; vacuum(into:limits:) writes a compacted snapshot
    without occupying the writer; integrityCheck(maxProblems:limits:) and
    quickCheck(maxProblems:limits:) return a typed SQLiteIntegrityReport;
    optimize(limits:) and incrementalVacuum(pages:limits:). Destinations are never
    overwritten, and a stopped or failed copy leaves no file.
  • Observation hooks: SQLiteConfiguration.observer takes an SQLiteObserver
    that sees every operation (SQLiteOperation.Kind: read, write, resolve_commit,
    checkpoint, backup, vacuum_into, integrity and quick checks, optimize,
    incremental vacuum) with the wait for a connection, the duration and the outcome
    (succeeded, rolled back, failed). Both callbacks run on the calling task, so
    task-local context (tracing, logging) is available. No observer, no cost.
  • Fault injection for consumers: SQLiteSwiftTesting adds
    SQLiteDatabase.injectFault(_:) with SQLiteFault.commitOutcomeUnknown, so a
    store can test its handling of an unknown commit with a real failing COMMIT.
  • Server bridges (SQLiteSwiftServer), each behind an opt-in package trait so the
    default dependency graph stays empty: SQLiteMetricsObserver (trait Metrics,
    swift-metrics: operation duration, connection wait, error counts with bounded
    dimensions), SQLiteTracingObserver (trait Tracing, swift-distributed-tracing:
    a client span per operation, nested under the caller's span, errors recorded),
    SQLiteLoggingObserver (trait Logging, swift-log, Logger.current by default),
    SQLiteDatabaseService (trait ServiceLifecycle: closes the database on graceful
    shutdown, optional scheduled checkpoint and optimize). SQLiteObservers combines
    several observers.
  • Migration checksums (opt-in): SQLiteConfiguration.verifiesMigrationChecksums
    records each applied migration's checksum (FNV-1a 64 of version, name and SQL)
    in sqliteswift_migration_checksums and refuses a file whose applied migrations
    changed (SQLiteError.Code.migrationModified) before any new migration runs.
    Existing files are adopted, not refused.
  • SQLite release watch: Scripts/check-sqlite-release.sh and a weekly workflow that
    opens an issue (once per release) when sqlite.org publishes a newer amalgamation.
  • FTS5 full-text search on Linux (the vendored engine is compiled with
    SQLITE_ENABLE_FTS5), matching Apple's system SQLite.

Changed

  • Developer kit 0.2.0: pinned to library 1.0.0 (tag, commit and tree in its
    compatibility map); new integrations use from: "1.0.0"; the version reference
    lists 1.0.0. All 13 recipes pass against the published 1.0.0 tag.
.package(url: "https://github.com/ThorFuchs/Swift-SQLite.git", from: "1.1.0")
// Server bridges, opt in per trait:
.package(url: "https://github.com/ThorFuchs/Swift-SQLite.git", from: "1.1.0",
         traits: ["Metrics", "Tracing", "Logging", "ServiceLifecycle"])

1.0.0

Choose a tag to compare

@ThorFuchs ThorFuchs released this 15 Nov 14:16
44120e9

The first stable release. The public API is the one frozen in 0.9.0, unchanged:
from now on, only a major release may break source compatibility. 0.9.0 was
validated downstream by Swift-MCP-Server-Core (build, its task-store tests and the
conformance kit, also under ThreadSanitizer) with nothing changed but its version
pin.

Upgrading from 0.9.0: change the requirement to from: "1.0.0"; no code changes.

Documentation

  • ROADMAP: the plan after 1.0.0 — 1.1.0 operates it on a server, 1.2.0 brings
    the model layer to servers, profiles follow by demand; a modern-Swift watch list
    and clearer non-goals.

Added

  • A dependency-free benchmark package (Benchmarks/, Scripts/run-benchmarks.sh)
    and a recorded baseline for 1.0.0 (Documentation/Benchmarks.md).
  • CI: the GitHub-hosted macOS job also runs the tests with the Swift 6.2 upcoming
    feature NonisolatedNonsendingByDefault (SE-0461); all tests pass with it.
  • Developer kit 0.1.0 for coding agents, pinned to library 0.9.0: an
    instruction-only swift-sqlite skill (Claude Code plugin marketplace and the
    portable Agent Plugins format) with references and 13 recipes compiled and run
    from one consumer package. Scripts/validate_developer_kit.py,
    Scripts/run_kit_recipes.sh and Scripts/package_developer_kit.py; CI validates
    the kit and runs every recipe against each pull request. The library is unchanged.
  • AGENTS.md for contributors.
  • NOTICE file (Apache-2.0); SPDX headers on every source, script and workflow
    file.

Changed

  • README: release, Swift and platform badges, an overview of the four products and
    the developer kit, when the package fits and when not, and the protected main.
  • CONTRIBUTING, SECURITY, the bug report form (a product field) and the pull
    request template cover the model layer and the developer kit.
  • The observable-context research spike is marked as historical and points to the
    shipped model layer.

Everything since 0.2.0

The frozen API, the opt-in model layer (SQLiteSwiftModels, SQLiteSwiftModelContext) and the public-repository work arrived in 0.9.0; see the CHANGELOG.

.package(url: "https://github.com/ThorFuchs/Swift-SQLite.git", from: "1.0.0")

0.9.0 — release candidate for 1.0.0

Pre-release

Choose a tag to compare

@ThorFuchs ThorFuchs released this 15 Nov 09:10
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.