Unsolved local database back up if connection not found
-
Hello,
I would like use qml + js to work with database but I know how to do locally and now I want to do if with server but keep a back up to use the local one in case the connection is missing, any one can give me script for that?
Thank a lot
Philippe -
Hi,
If I understand you correctly, you want to keep a copy of the remote database locally in case the network goes down ?
-
yes exactly
-
And no error in case the network goes down, just the api still working with the local database and only an advise to inform we are in local using and soon the network go back online, update it with le lastest version
-
Then you should rather do "offline first", i.e. save everything in your local database and then send things remotely.
-
oh, ok then bad news, because in case I'm use an other computer, I will overwrite the online database and have risk to copy older one replacing the latest one
-
I'm little bit stupid, of course it will overwrite, discard this last post lol
-
Are you looking for something working like Firebase ?
-
yes, I need to be able to use the API any time, connection or not
-
Then QtDataSync project might be of interest.
WARNING I haven't tested it, just did a quick search on the theme.
-
thank you very much! I will try that and will post comments here in case somebody else need the same thing
-
@filipdns it looks like you're posting a problem related to database replication and not regarding Qt itself. I mean, you may rely on replication from the DB engine(s) you're using (i.e. Oracle, PostgreSQL, even there's replication based on sqlite) so I'd try setting up a good replication schema of replication between the central server and your PCs and then make Qt application always connect locally to DB, and all the DB synchronization will be carried on magically by the DB engine...
-
Oh yes you are right, I didn't think To this side thank you