{"id":16684750,"url":"https://github.com/priteshrnandgaonkar/kvstore","last_synced_at":"2025-07-11T05:33:52.545Z","repository":{"id":56917712,"uuid":"81708561","full_name":"priteshrnandgaonkar/KVStore","owner":"priteshrnandgaonkar","description":"Swift wrapper over sqlite to store key value pairs in db 🎊🎈","archived":false,"fork":false,"pushed_at":"2017-07-19T12:38:53.000Z","size":148,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T17:18:33.259Z","etag":null,"topics":["key-value","sqlite","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/priteshrnandgaonkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-12T06:51:08.000Z","updated_at":"2020-09-07T14:21:39.000Z","dependencies_parsed_at":"2022-08-21T04:50:52.008Z","dependency_job_id":null,"html_url":"https://github.com/priteshrnandgaonkar/KVStore","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priteshrnandgaonkar%2FKVStore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priteshrnandgaonkar%2FKVStore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priteshrnandgaonkar%2FKVStore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/priteshrnandgaonkar%2FKVStore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/priteshrnandgaonkar","download_url":"https://codeload.github.com/priteshrnandgaonkar/KVStore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131470,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["key-value","sqlite","swift"],"created_at":"2024-10-12T14:44:57.314Z","updated_at":"2025-04-09T23:41:56.701Z","avatar_url":"https://github.com/priteshrnandgaonkar.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KVStore ![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat) ![Pod Support](https://img.shields.io/cocoapods/v/KVStore.svg?maxAge=2592000)\n\nKVStore is a wrapper over sqlite to store and persist key value pairs.\n\n## Demo\nHave a look at the [demo app](https://appetize.io/app/773rqj6a096emec0gn92dd3bn0?device=iphone7\u0026scale=75\u0026orientation=portrait\u0026osVersion=10.3)\n# Installation\n### CocoaPods\n\n[CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```\n$ gem install cocoapods\n\n```\nTo integrate CardsStack into your Xcode project using CocoaPods, specify it in your Podfile:\n\n```\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'KVStore', '1.3'\nend\n\n```\nThen, run the following command:\n\n```\n$ pod install\n```\n\n### Carthage\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```\n$ brew update\n$ brew install carthage\n\n```\nTo integrate CardsStack into your Xcode project using Carthage, specify it in your Cartfile:\n\n```\ngithub \"priteshrnandgaonkar/KVStore\" == 1.5\n\n```\nRun `carthage update` to build the framework and drag the built CardsStack.framework into your Xcode project.\n\n# How to use?\n\nCreate 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\n\n\n``` swift\ndo {\n\tlet storeManager = try KVStoreManager(with: \"TestKVPersistence\")\n}\ncatch (let error) {\n\tshowAlert(withTitle: \"Error\", buttonTitle: \"OK\", message: error.localizedDescription, okAction: nil)\n}\n```\n\nFrom 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.\n\nThis `KVStoreManager` has the following API's which eases the storage and fetching of data from sqlite database\n\n``` swift\n\nfunc insert\u003cT: Hashable\u003e(value: Data, for key: T) throws\nfunc deleteValue\u003cT: Hashable\u003e(for key: T) throws\nfunc update\u003cT: Hashable\u003e(value: Data, for key: T) throws\nfunc getValue\u003cT: Hashable\u003e(for key: T) -\u003e Data?\n \n```\n\nYou can also access the value through subscript syntax, like as follows\n\n``` swift\nlet data = storeManager[key]\n```\n\nThe 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`\n\nYou can checkout the example in the framework and play around with it. To get used to this library.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpriteshrnandgaonkar%2Fkvstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpriteshrnandgaonkar%2Fkvstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpriteshrnandgaonkar%2Fkvstore/lists"}