Amit
Amit

Reputation: 7035

what is the best way to create database using titanium

I have below 2 approach to create Db in titanium. Need to know which is the best approach out of these 2.

Approach 1 -- Create a sqlite database using a tool like 'SQLite Manager' and copying that database to app and using it.

Approach 2 -- Create a sqlite database, using queries in the titanium code. like Ti.Database.open("DBName"); and then create tables using sqlite queries

thanks amit

Upvotes: 1

Views: 1547

Answers (1)

Jeff Bonnes
Jeff Bonnes

Reputation: 1130

If the database is always going to be read-only, I'd go with #1. But if it will contain user entered data, you will eventually need to do #2 if you ever need to update the design of the database.

I've had apps that I needed to add features - that required new tables / indexes. You can't use approach #1 to modify a 'Version 1' database to your new design.

Upvotes: 4

Related Questions