Repository navigation
Releases
1.1.0
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"])1.0.0
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
featureNonisolatedNonsendingByDefault(SE-0461); all tests pass with it. - Developer kit 0.1.0 for coding agents, pinned to library 0.9.0: an
instruction-onlyswift-sqliteskill (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.shandScripts/package_developer_kit.py; CI validates
the kit and runs every recipe against each pull request. The library is unchanged. AGENTS.mdfor contributors.NOTICEfile (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 protectedmain. - 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
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.