YapDB is a collection/key/value store with a plugin architecture. It's built atop sqlite, for Swift & objective-c developers.
Objective-C
3,328
1,590 commits
updated Sep 7, 2022
YapDatabase is a collection/key/value store and so much more. It's built atop sqlite, for Swift & Objective-C developers, targeting macOS, iOS, tvOS & watchOS.
// Create and/or Open the database file
let db = YapDatabase()
// Configure database:
// We're going to store String's in the collection "test".
// To store custom classes/structs, just implement Swift's Codable protocol.
db.registerCodableSerialization(String.self, forCollection: "test")
// Get a connection to the database
// (You can have multiple connections for concurrency.)
let connection = db.newConnection()
// Write an item to the database
connection.readWrite {(transaction) in
transaction.setObject("hello", forKey: "world", inCollection: "test")
}
// Read it back
connection.read {(transaction) in
let str = transaction.object(forKey: "world", inCollection: "test") as? String
// str == "hello"
}
YapDB has the following features:
See what the API looks like in "hello world" for YapDatabase
Learn more by visiting the wiki
1,030 followers · starred May 2013
2,537 followers · starred Mar 2013
259 followers · starred Mar 2014
442 followers · starred Jan 2014
YapDB is a collection/key/value store with a plugin architecture. It's built atop sqlite, for Swift & objective-c developers.
Objective-C
3,328
1,590 commits
updated Sep 7, 2022
YapDatabase is a collection/key/value store and so much more. It's built atop sqlite, for Swift & Objective-C developers, targeting macOS, iOS, tvOS & watchOS.
// Create and/or Open the database file
let db = YapDatabase()
// Configure database:
// We're going to store String's in the collection "test".
// To store custom classes/structs, just implement Swift's Codable protocol.
db.registerCodableSerialization(String.self, forCollection: "test")
// Get a connection to the database
// (You can have multiple connections for concurrency.)
let connection = db.newConnection()
// Write an item to the database
connection.readWrite {(transaction) in
transaction.setObject("hello", forKey: "world", inCollection: "test")
}
// Read it back
connection.read {(transaction) in
let str = transaction.object(forKey: "world", inCollection: "test") as? String
// str == "hello"
}
YapDB has the following features:
See what the API looks like in "hello world" for YapDatabase
Learn more by visiting the wiki
1,030 followers · starred May 2013
2,537 followers · starred Mar 2013
259 followers · starred Mar 2014
442 followers · starred Jan 2014