stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.67k stars 1.56k forks source link

Error: "attempt to write a readonly database (code: 8)" on real device when insert? #955

Closed khacdat1994 closed 4 years ago

khacdat1994 commented 4 years ago

please help me! thank

updev0612 commented 3 years ago

Hello. Khadat. how did you solve this issue?

rgkobashi commented 6 months ago

A bit late to the discussion but just in case...

I got that error when trying to make operations in an already existing DB (dragged and droped the file into the project). I was trying to read the DB from the bundle but you cannot manipulate any files inside, what I had to do was moving that file into another directory. More info in this issue: https://github.com/stephencelis/SQLite.swift/issues/766