Re: sqlite: foreign keys

2010-09-29 Thread Thierry

Le 28 sept. 2010 à 23:59, Monte Goulding a écrit :

 Just use an in-memory db.
 
 ooo, that's a new one to me. Is it possible to write it out to a file later?


Hi,

Running SQLite without a database file creates an in-memory database.
Using the .dump command will dump that in-memory DB to a SQL file that
can then be re-read into a file-backed database (or back into a memory
database)

But
Sqlite  caches data in memory so a file based database and memory based perform 
much the same.

Well, depends of what you want to achieve...


HTH

Thierry



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sqlite: foreign keys

2010-09-28 Thread Trevor DeVore

On Sep 25, 2010, at 3:42 PM, David Bovill wrote:

A quick geeky question: does anyone know if foreign key support has  
been

turned on for the recent sqlite driver


I don't think you need to turn it on when compiling. It is a pragma  
setting:


http://www.sqlite.org/pragma.html#pragma_foreign_keys

Untested but try this:

revExecuteSQL theConnectionID, PRAGMA foreign_keys = true

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: 
http://revolution.bluemangolearning.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sqlite: foreign keys

2010-09-28 Thread Peter Haworth
I think the issue is whether the version of the sqlite drivers in  
LiveCode are up to date enough to include foreign key support at all.   
According to http://www.sqlite.org/foreignkeys.html, foreign keys were  
supported as of SQlite version 3.6.19 but I don;t know how to find out  
what version of sqlite is included with LiveCode.  If foreign key  
support is included, it's off by default so you do have to enable it  
as detailed by Trevor.


Pete Haworth

On Sep 28, 2010, at 10:00 AM, use-revolution-requ...@lists.runrev.com  
wrote:



Message: 14
Date: Tue, 28 Sep 2010 07:53:40 -0400
From: Trevor DeVore li...@mangomultimedia.com
Subject: Re: sqlite: foreign keys
To: How to use Revolution use-revolution@lists.runrev.com
Message-ID: 3f385a2b-214c-4867-8af6-08887fe46...@mangomultimedia.com
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

On Sep 25, 2010, at 3:42 PM, David Bovill wrote:


A quick geeky question: does anyone know if foreign key support has
been
turned on for the recent sqlite driver


I don't think you need to turn it on when compiling. It is a pragma
setting:

http://www.sqlite.org/pragma.html#pragma_foreign_keys

Untested but try this:

revExecuteSQL theConnectionID, PRAGMA foreign_keys = true

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: 
http://revolution.bluemangolearning.com


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sqlite: foreign keys

2010-09-28 Thread Trevor DeVore

On Sep 28, 2010, at 1:32 PM, Peter Haworth wrote:

I think the issue is whether the version of the sqlite drivers in  
LiveCode are up to date enough to include foreign key support at  
all.  According to http://www.sqlite.org/foreignkeys.html, foreign  
keys were supported as of SQlite version 3.6.19 but I don;t know how  
to find out what version of sqlite is included with LiveCode.  If  
foreign key support is included, it's off by default so you do have  
to enable it as detailed by Trevor.


4.5 comes with 3.6.22. You can check the version of SQLite included  
with the IDE by placing the following in a card script of a stack in  
your plugin folder. Just make sure the card has a single field on it.


on preopenCard
   put specialfolderpath(temporary) into theFolder
   put theFolder  /  the milliseconds  .db into theFile
   put revOpenDatabase(sqlite,theFile) into theConn
   put revDataFromQuery(tab, cr, theConn, SELECT sqlite_version())  
into theData

   revCloseDatabase theConn
   put Installed SQLite version:  theData into fld 1
   delete file theFile
end preopenCard

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: 
http://revolution.bluemangolearning.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sqlite: foreign keys

2010-09-28 Thread Trevor DeVore

On Sep 28, 2010, at 2:01 PM, Trevor DeVore wrote:


on preopenCard
   put specialfolderpath(temporary) into theFolder
   put theFolder  /  the milliseconds  .db into theFile
   put revOpenDatabase(sqlite,theFile) into theConn
   put revDataFromQuery(tab, cr, theConn, SELECT sqlite_version())
into theData
   revCloseDatabase theConn
   put Installed SQLite version:  theData into fld 1
   delete file theFile
end preopenCard


Actually, you don't even need the temporary file. Just use an in- 
memory db.


on preopenCard
  put revOpenDatabase(sqlite,) into theConn
  put revDataFromQuery(tab, cr, theConn, SELECT sqlite_version())  
into theData

  revCloseDatabase theConn
  put Installed SQLite version:  theData into fld 1
end preopenCard

--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: 
http://revolution.bluemangolearning.com

Email has been scanned for viruses by Altman Technologies' email management 
service - www.altman.co.uk/emailsystems
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sqlite: foreign keys

2010-09-28 Thread Bob Sneidar
Whaaa?? There's a such thing as an In Memory DB?? Wow! Nice tip!

Bob


On Sep 28, 2010, at 11:05 AM, Trevor DeVore wrote:

 Actually, you don't even need the temporary file. Just use an in-memory db.

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: sqlite: foreign keys

2010-09-28 Thread Monte Goulding
 Just use an in-memory db.


ooo, that's a new one to me. Is it possible to write it out to a file later?

--
Monte Goulding
M E R Goulding Software Development
Bespoke application development for vertical markets

InstallGadget - How to create an installer in 10 seconds
revObjective  - Making behavior scripts behave

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


sqlite: foreign keys

2010-09-25 Thread David Bovill
A quick geeky question: does anyone know if foreign key support has been
turned on for the recent sqlite driver -
http://www.hwaci.com/sw/sqlite/foreignkeys.html?
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution