Async Storage SQLite¶
Multiplatform key-value storage backed by SQLite for React Native Async Storage
Installation¶
Android¶
iOS¶
Quick start¶
Android¶
import org.asyncstorage.sqlitestorage.SQLiteStorageFactory
val storage = SQLiteStorageFactory(this).create("my_database_name")
suspend fun single(): Entry {
val entry = storage.read("my_key")
return entry
}
suspend fun singleWrite() {
val entry = Entry("my_key", "my_value")
storage.write(entry)
}
iOS¶
import AsyncStorageSQLite
let storage = AsyncStorageSQLite("my_database_name")
func single() async throws -> Entry {
let entry = try await storage.read(key: "my_key")
return entry
}
func singleWrite() async throws {
let entry = Entry(key: "my_key", value: "my_value")
try await storage.write(entry: entry)
}
Visit Usage page to learn more