Re: Shell Scripting SQLite
Re: Shell Scripting SQLite
- Subject: Re: Shell Scripting SQLite
- From: BareFeet <email@hidden>
- Date: Fri, 30 May 2008 23:05:02 +1000
Hi Mark,
Deviating from the OP's question, but prompted by part of your message:
anything going back to AppleScript has to be ... or written to a
file that AppleScript then goes and reads.
I've been thinking about implementing this method for greater speed
when dealing with large results, such as displaying the output in a
table view in an Xcode project. It seems to me that we could construct
a shell script to output the results of select statement to a file in
a format that would suit a subsequent "read file ... as list"
AppleScript statement. That would eliminate the need for AppleScript
to do the laborious parsing of text into a list. Something like:
set outputPath to "/tmp/SQLiteOutputForAppleScript
set sqlCommand to "select * from people;"
set mySeparator to "whatever AppleScript needs between list items in a
file"
do shell script "echo '.output " & outputPath & linefeed & sqlCommand'
| sqlite3 -separator " & (quoted form of mySeparator) " & quoted form
of myDBPath
...
set myAppleScriptList to read posix file outputPath as list
Does anyone know how this could be done so that the shell script
creates the file in a way that suits AppleScript reading it directly
in as a list?
Thanks,
Tom
BareFeet
_______________________________________________
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