• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shell Scripting SQLite
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Shell Scripting SQLite
      • From: Bruce Robertson <email@hidden>
    • Re: Shell Scripting SQLite
      • From: Philip Aker <email@hidden>
References: 
 >Re: Shell Scripting Sqlite (From: BareFeet <email@hidden>)
 >Re: Shell Scripting Sqlite (From: Bruce Robertson <email@hidden>)
 >Re: Shell Scripting Sqlite (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Targetting a specific Word version
  • Next by Date: Re: read file failing from an application bundle
  • Previous by thread: Re: Shell Scripting Sqlite
  • Next by thread: Re: Shell Scripting SQLite
  • Index(es):
    • Date
    • Thread