Repository navigation
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 withsqlite3_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 typedSQLiteIntegrityReport;
optimize(limits:)andincrementalVacuum(pages:limits:). Destinations are never
overwritten, and a stopped or failed copy leaves no file. - Observation hooks:
SQLiteConfiguration.observertakes anSQLiteObserver
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:
SQLiteSwiftTestingadds
SQLiteDatabase.injectFault(_:)withSQLiteFault.commitOutcomeUnknown, so a
store can test its handling of an unknown commit with a real failingCOMMIT. - Server bridges (
SQLiteSwiftServer), each behind an opt-in package trait so the
default dependency graph stays empty:SQLiteMetricsObserver(traitMetrics,
swift-metrics: operation duration, connection wait, error counts with bounded
dimensions),SQLiteTracingObserver(traitTracing, swift-distributed-tracing:
a client span per operation, nested under the caller's span, errors recorded),
SQLiteLoggingObserver(traitLogging, swift-log,Logger.currentby default),
SQLiteDatabaseService(traitServiceLifecycle: closes the database on graceful
shutdown, optional scheduled checkpoint and optimize).SQLiteObserverscombines
several observers. - Migration checksums (opt-in):
SQLiteConfiguration.verifiesMigrationChecksums
records each applied migration'schecksum(FNV-1a 64 of version, name and SQL)
insqliteswift_migration_checksumsand 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.shand 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 usefrom: "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"])