Swiftpack.co - yechentide/LvDBWrapper as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by yechentide.
yechentide/LvDBWrapper v1.1.0
A Objective-C++ wrapper for leveldb.
⭐️ 0
🕓 5 weeks ago
iOS macOS
.package(url: "https://github.com/yechentide/LvDBWrapper.git", from: "v1.1.0")


A Objective-C++ wrapper for leveldb.


(you can also use SPM from Xcode)

let package = Package(
    name: "Demo",
    platforms: [
    products: [
        .executable(name: "demo", targets: ["Demo"]),
    dependencies: [
        .package(url: "https://github.com/yechentide/LvDBWrapper", branch: "main")
    targets: [
        .executableTarget(name: "Demo", dependencies: [
            .product(name: "LvDBWrapper", package: "LvDBWrapper")

import & use

import LvDBWrapper

guard let db = LvDB(dbPath: "db-dir-path") else { ... }

let wellKnownKey = "~local_player".data(using: .utf8)!
guard let key = db.key(), let value = db.value() else { return }

var firstToLastCount = 0
while db.valid() {
    firstToLastCount += 1


This package wrapped 2 kind of c++ libraries: libz & libleveldb.
Each xcframework contains 3 static .a files for iOS(arm64), MacOS(arm64), Simulator(arm64).

iOS(arm64) MacOS(arm64) MacOS(x86) Simulator(arm64) Simulator(x86)
libz.xcframework ✔︎ ✔︎ ✔︎ ✔︎ ×
libleveldb.xcframework ✔︎ ✔︎ ✔︎ ✔︎ ×


For MacOS projects, you can use this package directly.

For iOS projects, you need to do some additional work.
The static libraries for iOS platform, are built with my personal apple team account.
Maybe my account will expire some day and I can't and won't offer any guarantees.
So if your projects is for iOS, you must rebuild libz.a and libleveldb.a for iOS.
In this case, please replace the following files:

Build XCFramework yourself

Just run the script and add teams or change the minimum version when needed. It's so easy!

git clone https://github.com/yechentide/LvDBWrapper.git
cd LvDBWrapper/scripts
chmod u+x build.sh

After you get the xcframeworks, you can fork this repository, and swap xcframeworks in frameworks directory.


Stars: 0
Last commit: 5 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

9 weeks ago

Support iOS(arm64), MacOS(arm64/x86), Simulator(arm64)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics