Is there a way to pre allocate my SQLite database to a certain size? Currently I’m adding and deleting a number of records and would like to avoid this over head at create time.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is a hack – Insert a bunch of data into the database till the database size is what you want and then delete the data. This works because:
Naturally, this isn’t the most reliable method. (Also, you will need to make sure that auto_vacuum is disabled for this to work). You can learn more here – http://www.sqlite.org/lang_vacuum.html