Storez alternatives and similar libraries
Based on the "Database" category.
Alternatively, view Storez alternatives based on common mentions on social networks and blogs.
-
MMKV
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX. -
YapDatabase
YapDB is a collection/key/value store with a plugin architecture. It's built atop sqlite, for Swift & objective-c developers. -
ParseAlternatives
DISCONTINUED. GraphQLite is a toolkit to work with GraphQL servers easily. It also provides several other features to make life easier during iOS application development. [Moved to: https://github.com/relatedcode/GraphQLite] -
Unrealm
Unrealm is an extension on RealmCocoa, which enables Swift native types to be saved in Realm. -
Prephirences
Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, configurations and app-state. UserDefaults -
PredicateEditor
A GUI for dynamically creating NSPredicates at runtime to query data in your iOS app. -
realm-cocoa-converter
A library that provides the ability to import/export Realm files from a variety of data container formats. -
SecureDefaults
Elevate the security of your UserDefaults with this lightweight wrapper that adds a layer of AES-256 encryption -
MySQL
A stand-alone Swift wrapper around the MySQL client library, enabling access to MySQL servers. -
PersistenceKit
Store and retrieve Codable objects to various persistence layers, in a couple lines of code! -
PersistentStorageSerializable
Swift library that makes easier to serialize the user's preferences (app's settings) with system User Defaults or Property List file on disk. -
PostgreSQL
A stand-alone Swift wrapper around the libpq client library, enabling access to PostgreSQL servers. -
ObjectiveRocks
An Objective-C wrapper for RocksDB - A Persistent Key-Value Store for Flash and RAM Storage. -
MongoDB
A stand-alone Swift wrapper around the mongo-c client library, enabling access to MongoDB servers. -
FileMaker
A stand-alone Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers.
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Storez or a related project?
Popular Comparisons
README
Storez :floppy_disk: Safe, statically-typed, store-agnostic key-value storage
Highlights
Fully Customizable: Customize the persistence store, the
KeyType
class, post-commit actions .. Make this framework yours!Batteries Included: In case you just want to use stuff, the framework is shipped with pre-configured basic set of classes that you can just use.
Portability, Check!: If you're looking to share code between you app and extensions, watchkit, apple watch, you're covered! You can use the
NSUserDefaults
store, just set your shared container identifier as the suite name.
Example:
final class WeatherService {
private enum Keys: Namespace {
static let id = "weather-service"
static let temperature = Key<Keys, Double>(id: "temp", defaultValue: 0.0)
}
private let store: UserDefaultsStore
var temperature: Double {
return store.get(Keys.temperature)
}
init(store: UserDefaultsStore) {
self.store = store
}
func weatherUpdate(temperature: Double) {
store.set(Keys.temperature, temperature)
}
}
Features
Available Stores
Store | Backend | Subspec |
---|---|---|
UserDefaultsStore |
NSUserDefaults |
Storez/UserDefaults |
CacheStore |
NSCache |
Storez/Cache |
For all stores, simply use pod "Storez"
Type-safe, store-agnostic, nestable Key definitions
// Entries must belong to a "group", for namespacing
struct Animals: Namespace {
static let id = "animals"
}
let kingdom = Key<Animals, Void?>(id: "mammals", defaultValue: nil)
kingdom.stringValue // "animals:mammals"
// Nesting
struct Cats: Namespace {
typealias parent = Animals
static let id = "cats"
// Namespaces also have pre and post commit hooks
func preCommitHook() { /* custom code */ }
func postCommitHook() { /* custom code */ }
}
let cat = Key<Cats, Void?>(id: "lion", defaultValue: nil)
cat.stringValue // "animals:cats:lion"
Initialize the store you want
// Use UserDefaultsStore for this example
let store = UserDefaultsStore(suite: "io.kitz.testing")
let key = Key<GlobalNamespace, Int?>(id: "key", defaultValue: nil)
// With three simple functions
store.set(key, value: 8)
store.get(key) // 8
store.clear() // Start fresh every time for testing
Optionality is honored throughout
let nullable = Key<GlobalNamespace, String?>(id: "nullable", defaultValue: nil)
store.get(nullable)?.isEmpty // nil
store.set(nullable, value: "")
store.get(nullable)?.isEmpty // true
let nonnull = Key<GlobalNamespace, String>(id: "nonnull", defaultValue: "!")
store.get(nonnull).isEmpty // false
store.set(nonnull, value: "")
store.get(nonnull).isEmpty // true
Custom objects easily supported
NEW Simply conform to Codable
!
(You can still use UserDefaultsConvirtable
if needed)
struct CustomObject: Codable {
var strings: [String]
}
// custom objects properly serialized/deserialized
let customObject = CustomObject(
strings: ["fill", "in", "the"]
)
// let's add a processing block this time
let CustomValue = Key<GlobalNamespace, CustomObject?>(id: "custom", defaultValue: nil) {
var processedValue = $0
processedValue?.strings.append("blank!")
return processedValue
}
store.set(CustomValue, value: customObject)
store.get(CustomValue)?.strings.joinWithSeparator(" ") // fill in the blank!
Make your own KeyType
// For example, make an key that emits NSNotifications
struct MyKey<G: Namespace, V>: KeyType {
typealias NamespaceType = G
typealias ValueType = V
var stringValue: String
var defaultValue: ValueType
func didChange(oldValue: ValueType, newValue: ValueType) {
NSNotificationCenter.defaultCenter().postNotificationName(stringValue, object: nil)
}
}
Getting Started
Swift Package Manager
TODO: Write me
CocoaPods
CocoaPods is fully supported. You can choose which store you want to use (see above). Simply add the following line to your Podfile:
pod 'Storez/UserDefaults'
Motivation
I've seen a lot of great attempts at statically-types data stores, but they all build a tightly coupled design that limits the end-developer's freedom. With this framework, you can start prototyping right away with the shipped features, then replace the persistence store and KeyType
functionality with your heart's content and keep your code the way it is!
Author
Mazyod (@Mazyod)
License
Storez is released under the MIT license. See LICENSE for details.
*Note that all licence references and agreements mentioned in the Storez README section above
are relevant to that project's source code only.