Re: AppleScript access to databases
Re: AppleScript access to databases
- Subject: Re: AppleScript access to databases
- From: BareFeet <email@hidden>
- Date: Tue, 23 Mar 2010 11:23:22 +1100
On 23/03/2010, at 5:43 AM, Christopher Nebel wrote:
>> Yes, the Database Events OSAX is advertised as giving AppleScript access to SQLite databases...
>
> Uh, really? Where? Because if it's in any Apple-provided material, it's just wrong and should be fixed -- as has explained on the list, Database Events merely provides a simplified record-and-field database, not arbitrary SQL. The fact that it uses SQLite to do it is strictly an implementation detail.
It's been a while, so I had to go looking. I (and many others) got all excited when Tiger seem to promise AppleScript access to SQLite databases. Back then I posted the reply I've copied below. The Apple web page I quoted there no longer seems to exist. However I did find a similar quote here:
http://automator.us/developer-02.html#1003
which says in part:
>>> It demonstrates:
>>>
>>> • Use of a user-editable table view.
>>> • Use of the Database Events application to create and parse SQLite database files.
That implies that Database Events works with generic SQLite files, which it doesn't.
Some other early comments:
http://lists.apple.com/archives/Applescript-users/2005/May/msg00478.html
http://my.safaribooksonline.com/0596102119/400
http://discussions.apple.com/thread.jspa?threadID=302346
Thanks,
Tom
BareFeet
----
Archived at: http://lists.apple.com/archives/applescript-studio/2006/Oct/msg00066.html
Date: 19 October 2006 3:22:33 AM AEST
To: AppleScript Studio <email@hidden>
Subject: SQLite from AppleScript (was: Adding C code to AppleScript Studio project)
Hi Gordon,
> Hi - have you looked at the "Database Events" scripting addition?
Yes.
> That will do the basics, both from Applescript and AppleScript Studio.
It's misleading, I think, for Apple to imply that it provides access to SQLite databases:
http://www.apple.com/macosx/features/applescript/
"Data Events Suite: Create and parse SQLite databases."
It _uses_ an SQLite database to store data you throw at it, but it's a tiny implementation and can't be used to access any SQLite databases other than its own. It basically just defines a table consisting of two fields: fieldName and fieldValue. When you ask it to store a value in a field, it puts the field name in the fieldName field, and the value in the fieldValue field, rather than actually creating a field and putting a value in it.
Basically, the "Database Events" scripting addition reduces functionality but adds a level of complexity. SQLite is neat and powerful. Database Events is ugly and impotent.
> MacScripter clearly don't like it
Yes, they quote Matt Neuburg's "AppleScript - The Definitive Guide" as also "not liking it". I looked at it and independently don't like it.
> but I would suggest you give it a try, it is mainly intended to provide a persistent local storage for the running script rather than full blown database access.
Yes, it's very very limited, to the point of being practically useless.
It's a shame, because I think that Apple could have released a really nice, neat and powerful OSAX to access SQLite databases. It doesn't require a huge suite. The code (SQLite) is already compiled and built into the Mac OS. We just need an interface to it.
Thanks,
Tom
BareFeet
--
Comparison of SQLite GUI tools:
http://www.tandb.com.au/sqlite/compare/?ml
_______________________________________________
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