• 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: AppleScript access to databases
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript access to databases


  • Subject: Re: AppleScript access to databases
  • From: BareFeet <email@hidden>
  • Date: Mon, 22 Mar 2010 21:32:01 +1100

On 22/03/2010, at 8:29 PM, Axel Luttgens wrote:

>> 	set shellCommand to "echo " & (quoted form of sqlCommand) & " | " & sqlite3Path & space & quoted form of databasePath

> This is just about a detail...
> Perhaps would it be more appropriate to make use of:
>
> 	/usr/bin/sqlite3 <path to db> <sql statements>
>
> instead of:
>
> 	echo <sql statements> | /usr/bin/sqlite3 <path to db>

Thanks for the feedback.

Unfortunately, no, that won't work all commands. I used to do it that way, but soon found it didn't work for all. I think the problem was with those commands that run over multiple lines.

> It may be expected to be slightly more efficient

I doubt that the speed difference would actually be significant.

> one also should avoid the various prompts from an interactive session

Piping the commands into the sqlite3 command doesn't start an interactive session.

> as well as the possible transformation of <sql statements> by the echo command.

The "quoted form" AppleScript operator seems to take care of that.

Thanks,
Tom
BareFeetWare

 --
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

  • Follow-Ups:
    • Re: AppleScript access to databases
      • From: Axel Luttgens <email@hidden>
References: 
 >Re: A bit of philosophy about Database events (From: Rob Lewis <email@hidden>)
 >AppleScript access to databases (was: A bit of philosophy about Database events) (From: BareFeet <email@hidden>)
 >Re: AppleScript access to databases (was: A bit of philosophy about Database events) (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: AppleScript access to databases (was: A bit of philosophy about Database events)
  • Next by Date: Extract item from a list
  • Previous by thread: Re: AppleScript access to databases (was: A bit of philosophy about Database events)
  • Next by thread: Re: AppleScript access to databases
  • Index(es):
    • Date
    • Thread