Optimize import from file to sqlite database in Titanium Mobile (general use)

I recently faced an app for ipad that checking whether a particular folder had contained text, it had to proceed with an import of all files in the database. In practice, a reset of the db.
This is the first cycle, for each file found i create import queries:

The important point are the commands:

This commands determine the start and the end of the import process.
The Begin indicates we are starting a series of queries that are going to query the database, while the Commit marks the end of the whole process.
Then take all the sqlite query will process and making it much faster to process them one at a time.

Note: The best way is to package individual files for import and not the whole process, so you have better control over errors.
Like this:


  1. Danyelle Laro

    Hello! I’m at work browsing your blog from my new iphone 3gs! Just wanted to say I love reading your blog and look forward to all your posts! Carry on the superb work!

  2. I am surprised by the information in this article I found it to be not only incredibly motivating but it really also made me reflect. It is hard now a days to locate related information to ones search, so I’m happy that I found this blog post

Leave a Comment

Your email address will not be published. Required fields are marked *