Skip to content

Migrate from SQLite.swift to PureSwift/SQLite#9

Merged
colemancda merged 4 commits into
masterfrom
feature/dependencies
Jul 17, 2026
Merged

Migrate from SQLite.swift to PureSwift/SQLite#9
colemancda merged 4 commits into
masterfrom
feature/dependencies

Conversation

@colemancda

Copy link
Copy Markdown
Member

Summary

Replaces the stephencelis/SQLite.swift dependency with PureSwift/SQLite.

  • Package.swift — drop SQLite.swift + CSQLite (and the Android TARGET_OS_ANDROID branching) for a single PureSwift/SQLite dependency, which wraps the system SQLite3 on Apple platforms and links an embedded SQLite (via swift-sqlcipher) everywhere else. No more per-platform product conditions.
  • AttributeValue.swift — rewrite binding conversion for the closed enum Binding instead of the Any-based protocol with as? casts; add strict textValue/blobValue accessors so .string/.data decode only from their real storage classes.
  • CustomFunction.swift — replace the hand-rolled sqlite3_create_function_v2 C-API registration (and its SQLite3/CSQLite imports) with Connection.createFunction.
  • Database.swift / ModelData.swift / Relationship.swift / Predicate.swift — update call sites (Connection(path:), .binding on positional values, scalar(...)?.integer, row[...]?.textValue) and drop the now-redundant custom rowDictionaries() (provided by PreparedStatement).
  • EntityDescription.swift / ViewContext.swiftmutating column builder, read-only Connection init, and the borrowing/consuming ownership annotations required by the noncopyable Connection.
  • Tests — update CustomFunctionTests.swift's direct SQLite usage to the new API.

Behavior is preserved — the migration is API-only.

Test plan

  • swift test — all 60 tests pass, including custom-function and app-managed R*Tree prefilter tests.
  • BENCHMARK=1 swift test --filter DistancePerformanceBenchmarks — both distance benchmarks pass.

@colemancda
colemancda force-pushed the feature/dependencies branch from ba6ed2d to a9468c2 Compare July 17, 2026 01:11
@colemancda
colemancda merged commit 426d1cc into master Jul 17, 2026
13 checks passed
@colemancda
colemancda deleted the feature/dependencies branch July 17, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant