I'm new here, and I would like to start saying thank you to this forum, since its content is wonderful and very useful.
I'm starting my first app in iPhone, and it's based in loading data from a database and creating queries.
So I'd like to know which is the best SQL manager available to fill my tables, and establish the relationships between my tables, so I could export my database to the app.
I have read that the compatible format is SQLite to work after with XCode, so it should be a SQL manager that can be compatible with SQLite.
I don't need a connection to server/FTP/sockets, etc, because my database it's going to be part of my app, if it's not too large.
Thank you very much in advance, and have a nice day :-)
you probably want to use Core Data which allows you to easily set up tables, columns and relationships.
a couple of warnings though: The learning curve with core data is pretty steep and the way they have set it up doesn't make a whole lot of sense.
also a big warning: any time you make changes to your database schema (add tables, add columns, change columns etc) you have to completely delete your old database schema including all data and then recompile your code which will automatically create a new database. kind of a pain.
This means whatever echema you launch your 1.0 app to the app store is the schema you will keep for the entire lifetime of your app... so be VERY careful! I always add extra tables and columns to anticaipate future additions.
now there is, technically, a way to change the schema but it looks way too complicated to me and has too much risk that my app will not work once changed, so I would never, personally , ever change a schema once the app is released.
My suggestion would be to create a .sql file with terminal
open up terminal and type "sqlite3 myDatabase.sql" in the prompt.
create a table (eg: create table test (x integer primary key))
that way the database is created in the directory your terminal was at (by default your home directory)
Drag and drop the sql file into your Xcode project and look for some code to create a mutable copy of the database from your NSBundle to the app's Document directory.
from there i suggest using FMDB to communicate with the database.
It's a very easy to use sqlite database wrapper.
I'm new here, and I would like to start saying thank you to this forum, since its content is wonderful and very useful.
I'm starting my first app in iPhone, and it's based in loading data from a database and creating queries.
So I'd like to know which is the best SQL manager available to fill my tables, and establish the relationships between my tables, so I could export my database to the app.
I have read that the compatible format is SQLite to work after with XCode, so it should be a SQL manager that can be compatible with SQLite.
I don't need a connection to server/FTP/sockets, etc, because my database it's going to be part of my app, if it's not too large.
Thank you very much in advance, and have a nice day :-)
Use CoreData. It's simple to use compared to SQLITE and the management tool is built-in. You can get DB tools such as the Firefox plugin to work on tables for the DB or use other methods to load data. Lots of resources on web for you to Google.
Thank you very much to everyone for your kind replies.
I'll try with the choices you gave me.
The main problem is that the database is going to be updated monthly since the app is launched. So the best solution is to put the database as an external file in a server. How can I access to that file inside the code of my app? Because I have seen it's pretty easy to "call" the file if it is in the same folder of the app itself, but I don't know how to write the path of a file in a folder of an external server.