On 3 Nov 2009, at 7:23pm, Victor Mayevski wrote:

> Ok, I will rephrase my question although it appears that the answer is
> has been already preconceived. I am writing an abstraction layer to
> Sqlite where tables, views, triggers etc are presented as XOTcl
> Classes/Objects. If two different scripts access the database and one
> of them creates a new table, the other has no way of knowing about it
> unless it does some kind of polling periodically. That new table
> should appear as an XOTcl object in the running script.

The simplest thing is to poll PRAGMA schema_version.  This will change  
if a TABLE/INDEX/TRIGGER is created/deleted.  Only if PRAGMA  
schema_version changes is it worth looking in detail to see what was  
done.

<http://www.sqlite.org/pragma.html>

>  Well, the
> script that creates the table will also create the object.

The script that creates the table might be a different program,  
written in a language you don't know, that just happens to be running  
at the same time as your script.  Either you should be doing intra- 
process communication, in which case you don't need to use SQLite for  
communication, or you need to know about schema changes made by all  
programs, in which case you have to write some code that reacts to  
changes, in which case you might as well use that code in all your  
processes, whether it's the process that made the change or not.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to