Abdul Aleem
Abdul Aleem

Reputation: 729

Appcelerator Titanium | Creating your first App

I have started following create your first titanium app tutorial from the Appcelerator documentation.

Under Initialize the book collection section in point number 4, it says:

  1. Add the book to the collection and persist it to the database.

    myBooks.add(book); book.save();

and whole tutorial is working fine.

My question is, how/where can i see the values stored in database?

Upvotes: 0

Views: 148

Answers (1)

miga
miga

Reputation: 4055

You can use sql queries. Have a look at:

http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Database.ResultSet

there are some examples. You open it with __alloy__

var db = Ti.Database.open('_alloy_');
var rows = db.execute('SELECT * FROM books');
console.log('Row count: ' + rows.rowCount);
db.close();

you can also download the file and open it locally. There is another thread here Titanium: Where is the SQLite DB Stored? to see where the db is stored

Upvotes: 0

Related Questions