How to populate a large sqlite database on first run How to populate a large sqlite database on first run sqlite sqlite

How to populate a large sqlite database on first run


  • Plan A: ship a compressed SQLite database file and decompress it after installation; you should be able to omit indices and rebuild them later.
  • Plan B: copy the relevant parts of the CSV importer into your application, ship a compressed CSV file and load it into an empty database like the command line tool would. Official documentation page.


Create entire content into csv file possibly multiple csv files and compress into zip. I have checked with 32 mb csv file after compression the file become 482KB.

For Example

data1.csvdata2.csvdata3.csvdata4.csvdata5.csv

compress the files into data.zip and put file into asset folder, when importing - extract file from the zip one by one and insert into sqlite db.