Hi,

I know there is no real support for foreign keys, but I read about the  
genfkey tool in the shell.
This is probably based on the fk tool from Cody Pisto  
<cpi...@gmail.com> that I am also using.

I added support to use the fk source as library in my code to rewrite  
DDL statements on the fly.
Now I get into trouble because I like to recreate the database tables  
over existing tables.

Doing this usually requires to delete tables and recreate them. The fk  
tool was not implemented to
parse DROP TABLE rules, DELETE and SELECT statements. So when I use  
those statements in my application
it will fail.

My problem:

I want to backport my enhancements, but:

Is there a need for such a backport?

Is it worth to enhance the fk tool to read the DROP, DELETE and SELECT  
statements to fully rewrite
any SQL statements?

I think the DROP statement is simple, but with SELECT and DELETE I see  
some problems with the complexity
of sub queries and my experience with Lex & Jacc.

I mean, I use the on the fly rewrite to avoid administrative tools  
like the Sqlite shell to create databases. Until now
I create DDL scripts from UML models by using XSLT template. So my  
fallback would be rewriting the XSLT template
instead.

Another simple solution would be deleting the database file before  
recreating it, but this will break any plans for an
upgrade functionality.

I thought I could add the fk rewrite code to another library to enable  
foreign key support, but as a library it would
break existing code, if the mentioned SQL statements are not handled  
correctly. (wxDatabaseLayer)

How do you think about adding foreign key support by on the fly  
rewriting SQL statements?
(By adding a compile time flag to activate this)

Thanks

Lothar

-- | Rapid Prototyping | XSLT Codegeneration | http://www.lollisoft.de
Lothar Behrens
Heinrich-Scheufelen-Platz 2
73252 Lenningen








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

Reply via email to