Sunday, April 24, 2011

Working with SQLite in AIR: Part 1

Today we will start to learning about SQLite - a database that is built in AIR.

SQLite is a database that you can create and use in your AIR applications. You can create and save SQLite databases on the hard drive with your code, or you could make it temporary and delete it from memory when you close the application.

SQLite uses a languages which is called SQL - Structured Query Language. In this tutorial series we will learn how to create new data bases, how to write and read data from them, update them and so on.

There are a lot of ways of making all kinds of data bases. SQLite is a database that works with tables. This is pretty common and simple to understand database. There can be multiple tables at the same time in one SQLite database.

Table based databases consist of rows and columns, where columns are like attributes in an XML database, and each row is a different item. For example, if you want to store data about peoples' names and ages, your database could look like this:

First nameLast nameAge
JohnJackson25
BobThompson20
RichardAnderson30

It is always recommended to have some kind of identificator for each row, a unique ID that we can use to later refer to this row by. We can do that by having a column called ID in our table, where each row has a different value:

IDFirst nameLast nameAge
0JohnJackson25
1BobThompson20
2RichardAnderson30

Using the SQLite database engine that AIR uses, we can write these tables into one or multiple database files on your hard drive. Any action with the database is commenced through SQL - reading, writing, rewriting, updating and so on.

We'll learn about that in the next tutorials.

Thanks for reading!

Related:

Working with SQLite in AIR: Part 2
Working with SQLite in AIR: Part 3
Working with SQLite in AIR: Part 4
Working with SQLite in AIR: Part 5
Working with SQLite in AIR: Part 6
Working with SQLite in AIR: Part 7
Working with SQLite in AIR: Part 8
Working with SQLite in AIR: Part 9
Working with SQLite in AIR: Part 10
Working with SQLite in AIR: Part 11
Working with SQLite in AIR: Part 12

No comments:

Post a Comment