Stack
BoutiqueDB is a thin, layered Swift package over a vendored Turso engine binary. The layers are intentionally narrow so that each can be replaced or tested in isolation.Module responsibilities
Engine surface
BoutiqueDB opens the engine through Turso’s official language-binding C ABI (sdk-kit), not the limited sqlite3 compatibility path. The primary C header is sdk-kit/turso.h.
Key capabilities exposed through sdk-kit:
async_iofor cooperative, non-blocking engine I/O.experimental_featuresas a comma-separated list of opt-in flags.- Encryption cipher and key configuration at open time.
- Multi-process WAL coordination.
Warning: The legacybindings/c(sqlite3.h) path exists for compatibility but does not expose per-open feature flags orasync_io. New code should usesdk-kit.
Build and packaging
The Swift package distributes a multi-archTursoSDK.xcframework.zip as a GitHub release asset. Maintainers rebuild it with:
unsafeFlags and is validated for Swift Package Index and App Store distribution.
Concurrency model
BoutiqueDBis@MainActorso it is safe to reference from SwiftUI.- All engine I/O runs on a background
DatabaseActorthroughread,write, andwriteConcurrent. TursoStorepublishes anAsyncStreamof change events used byLiveQuery.concurrentWritesuses a separate connection withBEGIN CONCURRENT(MVCC) while keeping CDC on the primary handle.

