Use Minigraf from Swift. Store data in an embedded, single-file graph database and query it with bi-temporal Datalog.
In Xcode: File → Add Package Dependencies → enter this repo URL.
Or add to Package.swift:
dependencies: [
.package(url: "https://github.com/project-minigraf/minigraf-swift", from: "2.0.12")
]Each semver tag
v<version>points to a commit on theswift-releasesbranch. That commit holds thePackage.swiftwith the release's xcframework URL and checksum, plus the generated Swift sources. After the branch move,source-v<version>marks the matching commit onmainfor 3.x orv2.xfor 2.x. Releases up to v2.0.0 were tagged differently; see Older releases below. Thev2.0.1tag was moved to itsswift-releasescommit after the fact, so it resolves normally but has nosource-v2.0.1tag.
Before the tagging fix, the release workflow put the semver tag on the source commit, whose
Package.swift has a placeholder checksum and no generated sources. The tags v2.0.0 and
earlier do not resolve. For those versions, the working manifest is on the swift-v<version>
tag, which SPM cannot resolve by version. Pin that tag's commit instead, for example:
// swift-v2.0.0
.package(url: "https://github.com/project-minigraf/minigraf-swift", revision: "1307a095c1725d2813abbbdcf17557311d517d24")Use git ls-remote --tags https://github.com/project-minigraf/minigraf-swift 'swift-v*' to
find the commit for another version.
No release up to and including v2.0.8 compiles: its xcframework names the C module map
minigraf_ffiFFI.modulemap instead of module.modulemap, so the generated Swift cannot import
the FFI module ("cannot find type 'RustBuffer' in scope"). Use v2.0.9 or later.
Requires iOS 16+.
import MinigrafKit
let db = try MiniGrafDb.openInMemory()
let result = try db.execute(datalog: #"(transact [[:alice :name "Alice"]])"#)
print(result) // {"transacted":1}Requires Rust stable toolchain with iOS targets and Xcode.
rustup target add aarch64-apple-ios aarch64-apple-ios-sim
cargo build --target aarch64-apple-ios --release
cargo build --target aarch64-apple-ios-sim --release
cargo run --bin uniffi-bindgen -- generate \
--library target/aarch64-apple-ios/release/libminigraf_ffi.a \
--language swift \
--out-dir Sources/MinigrafKit/When core publishes a 2.x release, its cascade sends the full tag to this
repository in a core-release event. The default workflow on main uses
v2.x as the source for that tag and builds with the exact core crate version.
It builds and zips the iOS device and simulator xcframework, updates
Package.swift on swift-releases, and tags the package commit for SwiftPM.
The GitHub Release carries the zip. See the release guide on
main
for rehearsal and recovery details.
MIT OR Apache-2.0