FirebaseHelper alternatives and similar libraries
Based on the "Database" category.
Alternatively, view FirebaseHelper alternatives based on common mentions on social networks and blogs.
-
Realm
Realm is a mobile database: a replacement for Core Data & SQLite -
MMKV
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX. -
WCDB
WCDB is a cross-platform database framework developed by WeChat. -
SQLite.swift
A type-safe, Swift-language layer over SQLite3. -
GRDB.swift
A toolkit for SQLite databases, with a focus on application development -
SwiftyUserDefaults
Modern Swift API for NSUserDefaults -
YapDatabase
YapDB is a collection/key/value store with a plugin architecture. It's built atop sqlite, for Swift & objective-c developers. -
ParseAlternatives
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] -
Couchbase Mobile
Lightweight, embedded, syncable NoSQL database engine for iOS and MacOS apps. -
FCModel
An alternative to Core Data for people who like having direct SQL access. -
UserDefaults
Simple, Strongly Typed UserDefaults for iOS, macOS and tvOS -
CTPersistance
iOS Database Persistence Layer with SQLite, your next Persistence Layer! -
MongoKitten
Native MongoDB driver for Swift, written in Swift -
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 -
RealmIncrementalStore
Realm-powered Core Data persistent store -
UserDefaultsStore
Why not use UserDefaults to store Codable objects ๐ -
ObjectBox
Swift database - fast, simple and lightweight (iOS, macOS) -
PredicateEditor
A GUI for dynamically creating NSPredicates at runtime to query data in your iOS app. -
Nora
Nora is a Firebase abstraction layer for FirebaseDatabase and FirebaseStorage -
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 an additional 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. -
YapDatabaseExtensions
YapDatabase extensions for use with Swift -
TypedDefaults
TypedDefaults is a utility library to type-safely use NSUserDefaults. -
MongoDB
A stand-alone Swift wrapper around the mongo-c client library, enabling access to MongoDB servers. -
ObjectiveRocks
An Objective-C wrapper for RocksDB - A Persistent Key-Value Store for Flash and RAM Storage. -
PostgreSQL
A stand-alone Swift wrapper around the libpq client library, enabling access to PostgreSQL servers. -
SQLite
A stand-alone Swift wrapper around the SQLite 3 client library. -
Storez
๐พ Safe, statically-typed, store-agnostic key-value storage written in Swift! -
FileMaker
A stand-alone Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers.
Appwrite - The Open Source Firebase alternative introduces iOS support
* 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 FirebaseHelper or a related project?
README
FirebaseHelper
FirebaseHelper is a small wrapper over Firebase's realtime database, providing streamlined methods for get, set, delete, and increment values.
Features
- [x] Setup Firebase Realtime Database Ref
- [x] Read values (get)
- [x] Write/Update values (set)
- [x] Remove values (delete)
- [x] Increment values (increment)
Requirements
Swift 4
Installation
FirebaseHelper is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'FirebaseHelper'
Usage
Initialize an instance of FirebaseHelper
:
import Firebase
import FirebaseHelper
let firebaseHelper = FirebaseHelper(FirebaseDatabase.Database.database().reference())
FirebaseHelper(_ ref: DatabaseReference)
takes in a DatabaseReference
. Generally you'd want this to be the root of your database.
For convenience, you can add something like this to your project:
extension FirebaseHelper {
static let main: FirebaseHelper = {
FirebaseHelper(FirebaseDatabase.Database.database().reference())
}()
}
And now you can simply call FirebaseHelper.main
to access this instance of FirebaseHelper
from anywhere in your project.
Common Database Operations
Get
Example:
FirebaseHelper.main.get("users", "john123", "favoriteFood") { result in
switch result {
case .failure(let error):
// handle error
case .success(let data):
// get string from data
}
}
API:
public func get(_ first: String, _ rest: String..., completion: @escaping (Result<DataSnapshot, Error>) -> Void)
get()
takes in a variadic parameter of child nodes that will be built on the DatabaseReference
you initialized your instance of FirebaseHelper
on.
The callback returns a Result
:
public enum Result<T, Error> {
case success(T)
case failure(Error)
}
In this case, T
is DataSnapshot
. An error case will either be because an invalid child was passed in or some other error in your database.
Set, Delete, Increment
set()
, delete()
, and increment()
work similarly, but instead of returning a Result
, they simply return an Error
if one occurred, or nil
otherwise.
Examples:
// The first parameter is an `Any` that gets set at the specified path.
FirebaseHelper.main.set("pizza", at: "users", "john123", "favoriteFood") { error in
if let error = error {
// handle error
}
}
FirebaseHelper.main.delete("users", "john123", "favoriteFood") { error in
if let error = error {
// handle error
}
}
FirebaseHelper.main.increment(by: 5, "users", "john123", "favoriteFoodEatenThisMonth") {
if let error = error {
// handle error
}
}
APIs:
public func set(_ value: Any, at first: String, _ rest: String..., completion: @escaping (Error?) -> Void)
public func delete(_ first: String, _ rest: String..., completion: @escaping (Error?) -> Void)
public func increment(by amount: Int, at first: String, _ rest: String..., completion: @escaping (Error?) -> Void)
Note: You should only
set()
accepted value types. See Firebase docs.
Safely Make A DatabaseReference
You will often need to call more complex FirebaseDatabase
functions, such as building a query and calling observe(_ eventType: with block:)
on it. FirebaseHelper
can still help with that:
let ref = try? FirebaseHelper.main.makeReference("users", "john123", "eatingHistory")
let handle = ref?.queryOrdered(byChild: "timestamp").queryLimited(toLast: 50).observe(.value) { data in
// handle data
}
API:
public func makeReference(_ first: String, _ rest: String...) throws -> DatabaseReference
makeReference
will throw an error if passed an invalid child.
Collaborators
License
FirebaseHelper is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the FirebaseHelper README section above
are relevant to that project's source code only.