All Projects → Dcell → SwiftLvDB

Dcell / SwiftLvDB

Licence: MIT License
A fast key-value storage library , leveldb for swift

Programming Languages

swift
15916 projects
Objective-C++
1391 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to SwiftLvDB

dxram
A distributed in-memory key-value storage for billions of small objects.
Stars: ✭ 25 (+78.57%)
Mutual labels:  key-value-database, key-value-store
Pebblesdb
The PebblesDB write-optimized key-value store (SOSP 17)
Stars: ✭ 362 (+2485.71%)
Mutual labels:  leveldb, key-value-store
Immortaldb
🔩 A relentless key-value store for the browser.
Stars: ✭ 2,962 (+21057.14%)
Mutual labels:  key-value-database, key-value-store
rippledb
Embeddable key-value database engine in pure TypeScript, based on LSM-Tree
Stars: ✭ 33 (+135.71%)
Mutual labels:  leveldb, key-value-store
public
util toolkit for go.golang 通用函数包
Stars: ✭ 135 (+864.29%)
Mutual labels:  leveldb
papyruscs
PapyrusCS renders maps of Minecraft: Bedrock Edition worlds using C#, LevelDB and leaflet.
Stars: ✭ 221 (+1478.57%)
Mutual labels:  leveldb
dreamy-db
🔥 Dreamy-db - A Powerful database for storing, accessing, and managing multiple database.
Stars: ✭ 25 (+78.57%)
Mutual labels:  leveldb
redis
Baidu Ksarch Redis - a production solution of redis cluster
Stars: ✭ 89 (+535.71%)
Mutual labels:  key-value-database
curium
Bluzelle Decentralized Database Service
Stars: ✭ 61 (+335.71%)
Mutual labels:  key-value-store
level-test
Inject temporary and isolated level stores (leveldown, level-js, memdown or custom) into your tests.
Stars: ✭ 19 (+35.71%)
Mutual labels:  leveldb
DBMSology
The Paper List on Design and Implmentation of System Software
Stars: ✭ 67 (+378.57%)
Mutual labels:  key-value-store
nimdbx
Fast persistent key-value store for Nim, based on libmdbx
Stars: ✭ 77 (+450%)
Mutual labels:  key-value-store
cannyls
An embedded persistent key-value storage for Rust that is optimized for random-access workload and huge-capacity HDD
Stars: ✭ 104 (+642.86%)
Mutual labels:  key-value-store
RHKeyValueStore
Key-Value storage tool, based on WCDB (WeChat DataBase).
Stars: ✭ 20 (+42.86%)
Mutual labels:  key-value-store
gino-keva
A simple Git Notes Key Value store
Stars: ✭ 23 (+64.29%)
Mutual labels:  key-value-store
cachegrand
cachegrand is an open-source fast, scalable and secure Key-Value store, also fully compatible with Redis protocol, designed from the ground up to take advantage of modern hardware vertical scalability, able to provide better performance and a larger cache at lower cost, without losing focus on distributed systems.
Stars: ✭ 87 (+521.43%)
Mutual labels:  key-value-store
LevelDBDumper
Dumps all of the Key/Value pairs from a LevelDB database
Stars: ✭ 23 (+64.29%)
Mutual labels:  leveldb
exleveldb
Elixir wrapper around the Erlang module, eleveldb.
Stars: ✭ 41 (+192.86%)
Mutual labels:  leveldb
papyrusjs
papyrus.js renders maps of Minecraft: Bedrock Edition worlds using node.js, LevelDB and leaflet.
Stars: ✭ 53 (+278.57%)
Mutual labels:  leveldb
lua-leveldb
Lua bindings for google's leveldb library.
Stars: ✭ 50 (+257.14%)
Mutual labels:  leveldb

SwiftLvDB

SwiftLvDB CI

A fast key-value storage library , Leveldb for swift.

  • support basic types [int,float,double,bool,string...]
  • support Object [Object:NSCode]
  • support List
  • support HashMap
  • support memory cache(LRU)
  • support Codeable (V2.0.0)

Installation with CocoaPods

pod 'SwiftLvDB'

Usage

Create SwiftLvDB Object

let sldb = SwiftLvDB.sharedInstance
or
let sldb = SwiftLvDB(subName: "sldb")

If you use the same init:subName db in multiple threads, make sure that the SwiftLvDB instance is unique; invoke close() before init:subName

Set value for key

let testValue:String = "hello"
let testKey = "testSaveString"
SwiftLvDB.sharedInstance.set(testValue, forKey: testKey)

Get value for key

let testKey = "testSaveString"
let value = SwiftLvDB.sharedInstance.string(forKey: testKey)

Save struct, ArrayList or HashMap,Suggest use Codeable protocol

struct TestStruct:Codable,Equatable{
    var a:Int
    var b:String
    
    static func == (lhs: Self, rhs: Self) -> Bool{
        return lhs.a == rhs.a && lhs.b == rhs.b
    }
}
let testKey = "testSaveCodeable"
let testvalue = TestStruct(a: 1, b: "hello")
try sldb.set(testvalue, forKey: testKey)
sldb.codeableObject(TestStruct.self, forKey: testKey)
let testValue:[Int] = [1,2,3,4,5]
let testKey = "testSaveList"
try sldb.set(testValue, forKey: testKey)
sldb.codeableObject([Int].self, forKey: testKey)
var testValue:[String:Int] = [:]
testValue["1"] = 1
testValue["2"] = 2
    
let testKey = "testSaveList"
try sldb.set(testValue, forKey: testKey)
sldb.codeableObject([String:Int].self, forKey: testKey)

License

SwiftLvDB is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].