Skip to content

An Swift database library built over Google's LevelDB, a fast embedded key-value store written by Google.

License

Notifications You must be signed in to change notification settings

PursuitSunshine/SwiftLevelDB

Repository files navigation

Introduction

An Swift database library built over Google's LevelDB, a fast embedded key-value store written by Google.

Installation

By far, the easiest way to integrate this library in your project is by using CocoaPods.

  1. Have Cocoapods installed, if you don't already

  2. In your Podfile, add the line

     pod 'SwiftLevelDB'
    
  3. Run pod install

  4. Make something awesome.

How to use

Open database

 let db = LevelDB.open(db: "test.db")

Cache data

db.putCodable(true, forKey: "bool")

Get data

let getData = db.getCodable(forKey: "bool", type: Bool.self) ?? false

Delete data

 db.delete("bool")

Keys

 let keys: [Slice] = db.keys()

Close database

  db.close()

License

Distributed under the MIT license

About

An Swift database library built over Google's LevelDB, a fast embedded key-value store written by Google.

Topics

Resources

License

Stars

Watchers

Forks