groue / GRDBCombine

GRDB ❤️ Combine
MIT License
223 stars 16 forks source link

SQLite Error 14 #4

Closed adamek314 closed 5 years ago

adamek314 commented 5 years ago

I'm getting SQLite error 14 with the following code:

let localDataPath = NSSearchPathForDirectoriesInDomains(
        .documentDirectory, .userDomainMask, true).first!
let databaseURL = URL(fileURLWithPath: localDataPath).appendingPathComponent("foodyDB.sqlite")
dbPool = try! DatabasePool(path: databaseURL.path, configuration: config)

This worked in an earlier version of iOS, but is not working in iOS 13 beta 2.

let databaseURL = try! FileManager.default
        .url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
        .appendingPathComponent("foodyDB.sqlite")
dbPool = try! DatabasePool(path: databaseURL.path, configuration: config)

I'm getting the same error with this URL code, copied from the GRDB Combine sample app. The same app ran, but the same code did not in my own project

I'm guessing I need to change something in my XCode Project settings to get directory access. Any suggestions? What's new in iOS13 for directory access?

adamek314 commented 5 years ago

Error in my configuration.