Re: Database from AppleScript
Re: Database from AppleScript
- Subject: Re: Database from AppleScript
- From: T&B <email@hidden>
- Date: Thu, 17 Jan 2008 03:07:40 +1100
Hi Has,
Database Events is a simple object database. It's not a relational
database and not intended as a replacement for one. That it happens
to be built on SQLite is merely an implementation detail.
True. It's just unfortunate and misleading that Apple originally
promoted it as a way to "access SQL databases using AppleScript" or
similar (I can't find the exact quote right now. I think the Leopard
release notes replaced it, originally mentioned for Tiger). It would
be great to see Apple include a real SQLite scripting addition, since
SQLite databases are so common now in Mac apps (eg Mail, Address Book,
iCal, Bento, Firefox).
It's best to use one of the SQL scripting additions or even via do
shell script.
IIRC, the only SQL osax is SQLiteAddOns;
Yeah, that's the only SQLite one I've seen. It has a problem with type/
class of the results of a query, treating everything as text (rather
than text, numeric, null). I've seen other scripting additions for
MySQL and perhaps others.
there's also a couple of application-based options, e.g. Valentina.
I haven't used Valentia, though am aware of it. I think it uses its
own proprietary database format and requires accessing through the
GUI, so kind of the same boat as FileMaker. I may be wrong.
Not aware of any non-commercial solutions for AppleScript (other
than mucking about with 'do shell script', which is crude and slow)
Yeah, do shell is a bit of a kludge but it works. And it actually
works surprisingly well, since there's little overhead in sending a
SQL command (through AppleScript -> do shell -> sqlite3) compared to
the much faster processing power the SQLite engine then uses to
actually run the SQL that you send it. The biggest headache is if a
query results in a large table of data (since you have to parse it),
but that's unusual for workflow projects.
There's a starter here:
http://macscripter.net/articles/436_0_10_0_C/
although they're pretty common for other languages such as Python,
Ruby, etc.
I've not (yet) tried Python and Ruby.
PHP and no doubt others do too. AppleScript could use the PHP SQLite
routines, though I've yet to try it.
Tom
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden