FirebaseHelper alternatives and similar libraries
Based on the "Database" category.
Alternatively, view FirebaseHelper 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. -
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. -
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 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.