Database creation questions
First I'd like to say I am rather frustrated with the lack of doc's in creating database's. So i thought maybe someone would be able to shed some light on these questions.
I created a sqlite database, inserted some data into it using RazorSQL and put it in the resource folder for my app. Built a basic statement to retrieve the data.
var db = Titanium.Database.install('../WhatsNextMovies.sqlite','savedlist'); var rows = db.execute('SELECT * FROM savedlist'); while (rows.isValidRow()) { Titanium.API.info(rows.field(1) + 'n' + rows.field(0)); rows.next(); } // close database rows.close();
This is attached to a button for testing. In the debug window it shows only one record, which isnt anything near what I put in the database.
- I created insert statements in my js file and I get errors stating it can not file table, or if i use the example from KS it says it worked in the debug window but when i look at the sqlite data file in my resource folder nothing is there.
Question is where is the database so I can view what is inserted? Is it cached somewhere? Is there any example code other then the KS as that really doesnt explain how to set it up?
All I would like to do is insert data into a database, based on xml variables from a details page. Then recall that data into a table view later.
Can anyone help me out please?
2 Answers
-
I changed the file name of my xxxxx.sqlite database file to xxxxx.db
Don't know if this will help.
-
If you are developing on a Mac, the database should be created at:
~/Library/Application\ Support/iPhone\ Simulator/{iOS version}/Applications/{guid}/Library/Application\ Support/database/{app-name}.sql