Attach the files in the session, give a INSERT
selecting table data in each database. The base name (table surname) comes before the table.
ATTACH 'path/aqui/vihicles1.sqlite' as v1;
ATTACH 'path/aqui/vihicles2.sqlite' as v2;
ATTACH 'path/aqui/vihicles3.sqlite' as v3;
ATTACH 'path/aqui/vihicles4.sqlite' as v4;
INSERT INTO tblVehicle SELECT * FROM v1.tblVehicle;
INSERT INTO tblVehicle SELECT * FROM v2.tblVehicle;
INSERT INTO tblVehicle SELECT * FROM v3.tblVehicle;
INSERT INTO tblVehicle SELECT * FROM v4.tblVehicle;
DETACH 'path/aqui/vihicles1.sqlite';
DETACH 'path/aqui/vihicles2.sqlite';
DETACH 'path/aqui/vihicles3.sqlite';
DETACH 'path/aqui/vihicles4.sqlite';
I put in the Github for future reference.
Don’t think this case is too necessary because of the low volume, but some settings may be useful to improve performance:
Some examples that may help:
PRAGMA synchronous = OFF
PRAGMA journal_mode = MEMORY
This does not create indexes.
You can use one of the files to receive the others, then the indexes already exist. But the import can be much slower. I don’t know how is the optimization of Sqlite, but in the past it was faster to import without index and then create the index.
It would be good to test some situations and see how it works best for you.
It took a few seconds for it to contain exactly 18780 records. But it worked perfectly. the/
– viana