Skip to content

1.1.0

Latest

Choose a tag to compare

@ThorFuchs ThorFuchs released this 16 Nov 10:30
· 4 commits to main since this release
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"])