2
import GRDB

class MyView: UIViewController{
    override func viewDidLoad() {
    super.viewDidLoad()
        do{
            let dbPool = try DatabasePool(path: "/path/to/database.sqlite")
        }catch let error{
        print(error)
    }
    }
}

error is print SQLite error 14

what is SQLite error 14?

first use GRDB and first Call SqlLite

Why raise Error?

Ios 11.0 Swift 4.0 Grdb 2.10.0

Build to Iphone8 Simulater

1
  • check your temp location. Commented Jul 19, 2018 at 9:48

2 Answers 2

3

SQLite error code 14 means

Unable to open the database file.

You can get the description from there: https://sqlite.org/c3ref/c_abort.html

For your question, what exactly the path is? Are you hard coded the path? Don't hard code the path, use pattern like

let path = NSHomeDirectory() + "/Documents/database.sqlite"

to get your database's path to see if your issue can be solved.

Sign up to request clarification or add additional context in comments.

Comments

1

The best solution for error 14 is to change the settings in the directory where the database file is stored so that write access is provided to the database file. In order to do so, you can run the following commands in case the web server you are using runs as www-data. ;)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.