All Projects â†’ priteshrnandgaonkar â†’ KVStore

priteshrnandgaonkar / KVStore

Licence: MIT license
Swift wrapper over sqlite to store key value pairs in db 🎊🎈

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to KVStore

Filebase
A Simple but Powerful Flat File Database Storage.
Stars: ✭ 235 (+968.18%)
Mutual labels:  key-value
docs
Source code of the ArangoDB online documentation
Stars: ✭ 18 (-18.18%)
Mutual labels:  key-value
keyval-resource
a resource that passes key values between jobs
Stars: ✭ 39 (+77.27%)
Mutual labels:  key-value
raft-badger
Badger-based backend for Hashicorp's raft package
Stars: ✭ 27 (+22.73%)
Mutual labels:  key-value
SwiftStore
Key-Value store for Swift backed by LevelDB
Stars: ✭ 119 (+440.91%)
Mutual labels:  key-value
redis-multi-programming-language-practice
🖖 Learn how to use Redis, from beginner basics to advanced techniques | 最新 Redis ćș•ć±‚ćŽŸç†ćˆ†æžäžŽć€šèŻ­èš€ćș”ç”šćźžè·”
Stars: ✭ 28 (+27.27%)
Mutual labels:  key-value
Endb
Key-value storage for multiple databases. Supports MongoDB, MySQL, Postgres, Redis, and SQLite.
Stars: ✭ 208 (+845.45%)
Mutual labels:  key-value
quickmongo
Quick mongodb wrapper for beginners that provides key-value based interface.
Stars: ✭ 73 (+231.82%)
Mutual labels:  key-value
okdbc
A fast, light-weight key/value store with http & memcache(TCP/UDP) interface.
Stars: ✭ 28 (+27.27%)
Mutual labels:  key-value
beryldb
BerylDB is a fully modular data structure data manager that can be used to store data as key-value entries. The server allows channel subscription and is optimized to be used as a cache repository. Supported structures include lists, sets, multimaps, and keys.
Stars: ✭ 201 (+813.64%)
Mutual labels:  key-value
Dictionary
A dictionary data type with a fast b-tree based search
Stars: ✭ 39 (+77.27%)
Mutual labels:  key-value
keyv
Simple key-value storage with support for multiple backends.
Stars: ✭ 202 (+818.18%)
Mutual labels:  key-value
FastKV
FastKV is an efficient key-value storage library.
Stars: ✭ 275 (+1150%)
Mutual labels:  key-value
Cubdb
Elixir embedded key/value database
Stars: ✭ 235 (+968.18%)
Mutual labels:  key-value
react-keyevent
An easy-to-use keyboard event react component, Package size less than 3kb
Stars: ✭ 38 (+72.73%)
Mutual labels:  key-value
Libdict
C library of key-value data structures.
Stars: ✭ 234 (+963.64%)
Mutual labels:  key-value
DataTanker
Embedded persistent key-value store for .NET. Pure C# code.
Stars: ✭ 53 (+140.91%)
Mutual labels:  key-value
jsoning
✹ A simple key-value JSON-based persistent lightweight database. ✹
Stars: ✭ 70 (+218.18%)
Mutual labels:  key-value
trakeva
Transactions, Keys, and Values
Stars: ✭ 24 (+9.09%)
Mutual labels:  key-value
ansible-role-etcd
Ansible role for installing etcd cluster
Stars: ✭ 38 (+72.73%)
Mutual labels:  key-value

KVStore Carthage compatible Pod Support

KVStore is a wrapper over sqlite to store and persist key value pairs.

Demo

Have a look at the demo app

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate CardsStack into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'KVStore', '1.3'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate CardsStack into your Xcode project using Carthage, specify it in your Cartfile:

github "priteshrnandgaonkar/KVStore" == 1.5

Run carthage update to build the framework and drag the built CardsStack.framework into your Xcode project.

How to use?

Create an instance of type KVStoreManager. As the name suggest, its a store manager which manages data of the KVStore. It can be initialised as follows

do {
	let storeManager = try KVStoreManager(with: "TestKVPersistence")
}
catch (let error) {
	showAlert(withTitle: "Error", buttonTitle: "OK", message: error.localizedDescription, okAction: nil)
}

From the above code snippet, you can see that the init method for KVStoreManager is failable. The above initialisation may either fail in the execution of sqlite statements(which is highly unlikely) or the creation of database file.

This KVStoreManager has the following API's which eases the storage and fetching of data from sqlite database

func insert<T: Hashable>(value: Data, for key: T) throws
func deleteValue<T: Hashable>(for key: T) throws
func update<T: Hashable>(value: Data, for key: T) throws
func getValue<T: Hashable>(for key: T) -> Data?
 

You can also access the value through subscript syntax, like as follows

let data = storeManager[key]

The method definitions are self explanatory as to what they perform. The important point is that the key which is passed as argument should be of type Hashable and the value would be stored as Data

You can checkout the example in the framework and play around with it. To get used to this library.

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].