Swift/iOS binding for Minigraf — zero-config, single-file, embedded bi-temporal graph database with Datalog queries.
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.11")
]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. The matching source commit onmainis taggedsource-v<version>. 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/This repo receives a core-release repository_dispatch from the minigraf monorepo
cascade whenever a new version of the minigraf core crate is published. The release
workflow pins the new version, builds the xcframework for iOS device and simulator,
zips it, updates Package.swift on the swift-releases branch, tags that commit with the
semver tag SPM resolves, and creates a GitHub Release with the xcframework.
MIT OR Apache-2.0