Unsolved How to connect two or more pyqt5 desktop apps to one database locally or remotely
-
I have developed a pyqt5 desktop application using sqlite as database and installed for 5 users with each user having a separate database. Is it possible to point all five users to one database because I want to avoid backing up the database file everyday for each computer locally or remotely networked?
-
@LT-K101
Do you mean they should be able to write simultaneously to one database stored on a shared network drive (not what SQLite is for, why not MySQL server etc.?), or do you mean just each have their own database files separately as now but physically on a network share to simplify backing up? -
@JonB Yes exactly, they should be able to write simultaneously to one database stored on a shared network drive.
-
@LT-K101
Then I would use a database designed for that. -
@JonB Is there any tutorial for this please? I have checked online but I have not chanced on any tutorial.
-
@LT-K101 Tutorial for what? Knowing that SQLite is not suitable for what you want (unless you don't care about efficiency) is fundamental to SQLite, nothing to do with Qt.
-
@JonB Thanks for the heads up
-
@LT-K101
Just so you know. I wouldn't use SQLite for this, but if for whatever reason you wish to stick with that I read somewhere that one "can" have it multi-user-writes but every write (transaction?) locks the database from other processes trying to write (I don't know whether they wait or fail). Also from my experience shared locks across machines/network are slow. It might be tolerable if your write-lock contentions are infrequent. You would have to test, and make sure the separate SQLites properly see each other's changes.The "best" solution is a single SQL server (e.g. My SQL) running on the same machine as where the database files are located.