Skip to content

Instantly share code, notes, and snippets.

@groue
Created March 29, 2016 19:07
Show Gist options
  • Save groue/b55210fe94e3594b7759dc204c09d261 to your computer and use it in GitHub Desktop.
Save groue/b55210fe94e3594b7759dc204c09d261 to your computer and use it in GitHub Desktop.
import GRDB
/// The shared database queue.
var dbQueue: DatabaseQueue!
func setupDatabase() {
let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true).first! as NSString
let databasePath = documentsPath.stringByAppendingPathComponent("db.sqlite")
dbQueue = try! DatabaseQueue(path: databasePath)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment