One of the best parts about working with Adobe AIR applications is the ability to have applications that work both online and offline. Since Adobe AIR applications are desktop applications that can run without the browser and without the need for an HTTP server or middleware server (ColdFusion, .NET, PHP, etc), they can be used without a connection to the internet. Of course we still need to write code to handle the "sometimes connected" abilities of our application and sometimes we need to be able to store data that we would normally receive from the server. This data can be stored in an embedded SQLite database.
SQLite is best described on the SQLite home page:
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.
SQLite is self-contained and serverless, which means it can be embedded. And it has been embedded into the Adobe Integrated Runtime. Which means that we can quickly and easily use SQLite databases (which are single files) in our AIR applications. This is awesome.
Using SQLite databases in Adobe AIR applications is simple, but there is a lot to discuss. That is why I am going to be discussing this over several blog posts. Things we'll be discussing include:
- Synchronous vs Asynchronous database connections
- Creating Databases
- SQLite CRUD
- Prepared Statements
- Using Encrypted Databases
- Using the new offline AIR application support in ColdFusion 9
I am very excited about Adobe AIR. I have been working on a fairly large AIR application for internal use at my job and I have been using SQLite a lot. I have also been using Encrypted SQLite databases. I feel like I have a lot of good information and lessons learned to share. If there is anything else you would like to see me cover, please let me know. I do not have a release schedule for these posts, as I have not written any of them yet and I still need to organize my thoughts and code. I suspect it will span over the next few weeks.
If anyone has specific questions, or a burning need to have something covered more quickly, feel free to leave a comment or contact me.