stephencelis / SQLite.swift

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

No threadsafe makes it unsuitable for iOS #1018

Closed juanjoseluisgarcia closed 3 years ago

juanjoseluisgarcia commented 4 years ago

This library is not thread-safe and send error of 'database locked' if two threads access the db at the same time making the library unfit for iOS development. Since it is unlikely that the author is going to fix this I am switching to GRDB.Swift. This Repo is abandoned.

jyjblrd commented 3 years ago

I also had this issue. This part of the documentation explains how to solve this issue: Documentation.

Also, executing this sqlite command fixes the database locked issue: PRAGMA journal_mode=WAL;

juanjoseluisgarcia commented 3 years ago

Also, executing this sqlite command fixes the database locked issue: PRAGMA journal_mode=WAL;

Thanks for the heads up. I did not do that. Anyways I already switched to GRDB that includes the WAL mode with a connection pool, since I do not trust this library will be around for much longer. But again, thanks for this. It will serve me in the future.

jyjblrd commented 3 years ago

Yeah I think this project is abandoned, the current release still doesn't even compile on Xcode 12 (which isnt even in beta anymore). Its a shame because I really like how it this library makes sqlite typesafe.

juanjoseluisgarcia commented 3 years ago

Yeah I think this project is abandoned, the current release still doesn't even compile on Xcode 12 (which isnt even in beta anymore). Its a shame because I really like how it this library makes sqlite typesafe.

I still have the old code in an old branch and that branch compiles and executes in Xcode 12. What I do is to use SPM.

groue commented 3 years ago

Its a shame because I really like how it this library makes sqlite typesafe.

GRDB is quite type safe as well. And it deals with concurrency in a way that prevents troubles, and uses the database quite efficiently. Take control of your database: see Why Adopt GRDB? if you want more details.