Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Fritzables

macrumors regular
Original poster
May 6, 2011
149
1
Brisbane AUSTRALIA
Hi All,

As part of the application I am currently writing using XCode I want to use SQLite as the preferred database.

From what I can gather, to create a database, you do this via a terminal session. For example: sqlite3 test.db

If I wanted to create a database within XCode, how would I achieve this?

I am happy with all the SQL statements as I used this when I was coding under Visual Studio using SQL Server.

It just the creation of a database via XCode and SQLite. I am pretty new to all this Mac stuff.


Pete
 
Last edited by a moderator:
It just the creation of a database via XCode and SQLite. I am pretty new to all this Mac stuff.

I'm assuming your asking how to create a database programmatically when your program runs, as opposed to clicking something in XCode itself to create a database.

The sqlite3_open (or sqlite3_open16 or sqlite3_open_v2) function will create a database if the database attempting to be opened doesn't exist.
 
Xcode is a development tool. It's not a computer language.

Xcode itself can work with a number of different computer languages, such as C, Java, Python, and shell scripts. None of those are the same language, and you'd create a sqlite database in very different ways in each language.

So what language are you coding in?
 
Thanks Jimi,

That's all I need to know. Yes, to create a database within the application I am writing.

Chown33 - I am using Cocoa with XCode.


Pete
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.