ryanfowler / SwiftData

Simple and Effective SQLite Handling in Swift
MIT License
517 stars 93 forks source link

Multiple threads #12

Open eriktelepovsky opened 9 years ago

eriktelepovsky commented 9 years ago

All SwiftData operations are placed on a custom serial queue ("SwiftData.DatabaseQueue") and executed in a FIFO order. Thats great, but is there a way I could set my own queue? Imagine following scenario: I am saving a lot of data in background thread, but I don't want to freeze main UI thread in which the data are fetching/selecting. It is happening because all SQL queries are executed in same serial queue. It would be great if I can write into database in one queue and read from database in another.

ryanfowler commented 9 years ago

I'm looking into the easiest way to implement this without generating a bunch of errors. I have to do some research on concurrency in SQLite ...