Hi @ gwendal.roue
of SQLite I know... SQL
I use to be a SQL Server administrator and a RPG programer.
Let me write down what I'm thinking.
Let assume I've user A with his db and user B whit his db2.
The best case is if A and B do not use their db without advise each other. In that case A creates events or customer, backup the tables and send them to B. B updates his db and so on.
But this will be a lot constraining.
I assume A and B uses the App at the same time.
First problem: both creates a new customer.
I have a customer code that is simply the autoIncrementedPrimaryKey of GRDB.
As little as I know of SQLite it is in a single file, A can take it, send to B (with a new name) and will start a merge procedure. Make it the very beginning, both db have customer 1, with name, city, phone number and email. To see if it is the same customer the best way is the email, it had to be spelled correctly (and I have a check it contains a string, a @, another string, a dot and another string). Only difference can be upper or lower case, but that's not a problem to solve. The name can be written differently (ie My name is Marco Pirola, but A can write Pirola Marco or, even worse, use my entire name, Marco Andrea Pirola). The city is out of question. The phone number can be compared, but it's not mandatory.
So i found the customer 1 from A (A1) is different from customer 1 from B (B1). To merge the db I insert the new customer in the table... But A1 will be equal to B2 and A2 will be equal to B1.
If A create an event (to make it simple an Event had a location, a date and a customer, both location and customer are recorded in the Event table with their ID) he can't simply send the event to B, it have to be decoded.
In SQL Server probably I will create a Stored Procedure that makes the check, insert the customer and create a "decode table" that says A1 is equal to B2. When A send the event to B it first go thought the decode and arrives correctly to B. This may work if one of the two is a "master database" that collects all the changes and the decodes.
Then, on Sunday (or a choosen day and time) I can extract all database A and send it to B, replace the database of B and truncate the "decode table". At that time all the DB are the same, now that I think to it I should add a boolean column in every table that became true when the db is "fully copied", but it's false when the object is created. So I have to merge only the false row of every table, not the entire db.
This means I don't really need to know if SQLite db is in a single file or not.
During the week I can send only the false row when they are created using a script (create temporary table, makes checks insert new info in the tables and in the decode tables).
At the end of the week the Master Database send a copy of HIS false rows to the others, all the rows in all the db became true and the decode tables are truncated.
Seems a lot of work to me