Re: Learning SQLite by watching Core Data?
Re: Learning SQLite by watching Core Data?
- Subject: Re: Learning SQLite by watching Core Data?
- From: Allen Cronce <email@hidden>
- Date: Tue, 24 Jun 2008 07:05:22 -0700
Hi David,
We're also developing an SQLite3-based database application.
Unfortunately we can't use Core Data because we're building a cross
platform product. But we wanted to use Xcode's data modeler tool to
design a fairly complex database model.
To help us implement our application, we're using LiteSQL as the ORM
framework. LiteSQL is an open source toolset that allows a developer
to automatically create a C++ persistent class implementation from an
XML representation of the database schema. While not as full featured
as Core Data, LiteSQL is lightweight, easy to use, and fast.
In order to make LiteSQL work well with Xcode, I created a set of
scripts that allow us to automatically generate the LiteSQL persistent
class source code from the Xcode authored database model. The scripts
use a tool called "mogenerator", written by Jonathan ‘Wolf’ Rentzsch,
in conjunction with custom templates. With these tools in place, we
can change the database model and rebuild, automatically regenerating
the corresponding LiteSQL sources used to access our database.
If this sounds interesting, you might want to take a look at LiteSQL
here:
http://litesql.sourceforge.net/
And here's where you can find information about the "LiteSQL Xcode
Support" package that we gave to the LiteSQL community:
http://litesql.sourceforge.net/xcode.html
Note that we did have to tweak the library a little to get it to work
the way we wanted. We had to work around issues with their date
support, and obscured table names. See my posts to the LiteSQL mailing
list for details:
http://sourceforge.net/mailarchive/forum.php?forum_name=litesql-users
On a related note, one of my coworkers pointed out that Core Data is
not currently available on the iPhone. This means that developers who
wish to create iPhone applications on top of SQLite3 really don't have
a high level data modeling solution.
But we think that it should be fairly easy to use LiteSQL and the
scripts we've pulled together to develop iPhone database applications.
Sure the LiteSQL library would have to be built for the iPhone, but
that shouldn't be difficult. LiteSQL builds easily for any platform
that uses gcc. In fact, it builds out of the box for Mac OS X with no
problems.
Best,
--
Allen Cronce
On Jun 23, 2008, at 2:35 PM, David Carlisle wrote:
I am studying an application design by implementing it with Core
Data, then studying how I would move it to a platform where only
sqlite is available.
I appreciate the book recommendations. I found where the Definitive
Guide to SQLite is available as an ebook, so I might go that route.
Otherwise it is listed for 2-5 weeks.
I'm happy with my approach. I modified ISavant's suggested Unix
statement, realizing I needed a .sqlite suffix after my document
name to make it work, so that answered that question.
Ilan noted that Core Data does "undocumented voodoo" with sqlite,
which is good to be aware of.
I think poking around with sqlite3 and browsing the sqlite header
file suggests questions for when I buy the book.
DC
On Jun 23, 2008, at 2:14 PM, Ben Trumbull wrote:
David,
I highly recommend these two books:
<http://www.amazon.com/SQL-Practical-Developers-Kaufmann-Management/dp/0122205316/ref=sr_1_8?ie=UTF8&s=books&qid=1206749658&sr=1-8
>
<http://www.amazon.com/Definitive-Guide-SQLite/dp/1590596730/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1206749999&sr=1-1
>
Now I want to recreate the same thing using just SQLite. I don't
know SQLite, and I know very little Unix.
Why do you want to use SQLite directly ? I don't think it's
currently a good fit for your self described skill level. If
you're simply interested in learning, pick up those books, and
maybe one or two on UNIX, and hack at it.
--
-Ben
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden