Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Codezerker/LevelDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LevelDB

Swift wrapper for LevelDB

Build Status

Usage

let fileURL = URL(fileURLWithPath: "/path/to/database")
let database = LevelDB(fileURL: fileURL)

// put `key` to `value`
database["key"] = value

// get value for `key` 
print(database["key"])

// delete `key`
database["key"] = nil

// enumerate through keys
database.enumerateKeys { key, value in
    // ...
}

// enumerate through keys with a specific prefix
let keyPrefix = "prefix_"
database.enumerateKeys(with: keyPrefix) { key, value in
    // ...
}

TODO

  • Wrap batch write
  • Provide APIs to customize db/read/write/iterator options