issuing dot commands to sqlite through livecode

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

issuing dot commands to sqlite through livecode

Post by bbalmerTotalFluency »

Hello:

I'd like to issue some commands such as .tables and .mode and .timer etc. Is it possible from within livecode? I can't seem to make it work but there is an extremely good chance I have missed something clever.

Bruce
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: issuing dot commands to sqlite through livecode

Post by Klaus »

Hi Briuce,

looks like LC does really not like commands/functions that start with a DOT! :shock:
Use the underscore instead, that does not make any problems.

Or are these (.table etc.) special SQLite commands?
In that case you can surely use them like -> put ".table" into tSQL


Best

Klaus
bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

Re: issuing dot commands to sqlite through livecode

Post by bbalmerTotalFluency »

Hi Klaus:

Are you paid to answer questions or are you simply the most generous guy I've met (virtually)? If the former "what a good job you are doing", if the latter "blimey! What a nice guy".

.commands are special commands in sqlite3 for example if I am running sqlite3 in my terminal and I issue ".tables" sqlite3 will provide me a list of all the tables in the attached database.

I've tried issuing them from within LC but so far LC has been unresponsive to my charms. To be specific I can issue the command of course but sqlite3 will not provide me with a response.

Bruce
SparkOut
Posts: 2984
Joined: Sun Sep 23, 2007 4:58 pm

Re: issuing dot commands to sqlite through livecode

Post by SparkOut »

Klaus is a REALLY nice guy.
And he's 8)

There are some (rather occasional) visits and posts by LC staff, but this is a user to user help forum, everyone is a volunteer, and it's not the normal channel of support from LC.
AxWald
Posts: 578
Joined: Thu Mar 06, 2014 2:57 pm

Re: issuing dot commands to sqlite through livecode

Post by AxWald »

Hi,

AFAIK ".tables" is syntax specific to the SQLite command-line program ("sqlite3"/ "sqlite3.exe"), and NOT part of the supported "dialect of the SQL language".

Since LC communicates with the DB using queries in "SQL language" this may not work. But you may use it via shell:

Code: Select all

   get shell(myPath & slash & "sqlite3 .tables")
(or something like it ;-))

I may be wrong. Have fun!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

Re: issuing dot commands to sqlite through livecode

Post by bbalmerTotalFluency »

AxWald:

Genius! That, or some form of that will be the answer. Thank you SO MUCH. I love it!

Bruce
Post Reply