>
>
>
> You're both right.  Igor's statement pretty-much /is/ the reason one
> cannot rename a column.  One would need to write a parser and changer for
> SQL statements that could identify and change column names in many
> statements with all sorts of weird possibilities for formatting.
>
> Two alternatives: (a) actually write the parser-and-changer that processes
> SQL commands, or (b) wait until the major file format changes in SQLite4,
> then change the way SQL stores the CREATE commands needed to construct a
> database so it stores a structured version of the commands instead of the
> raw text.
>
> The advantage of either change would be that it allows almost all the
> ALTER TABLE commands SQL users expect, not just changing column names.
>  This simplifies life not just for normal users but also for all the
> writers of SQLite GUI managers out there, who have to write nasty risky
> time-consuming hacks if they want to accomplish those operations.
>
> Simon.
>

SQLiteAdmin is one of those "nasty, risky, time consuming hacks" :-)  It
provides a way to rename a column and deals with changing the name in all
the places it could occur in the database, plus just about any db structure
changes that you'd want to do.  Not as good as a built-in solution
admittedly but it's saved my bacon several times.  If interested, check it
out at www.lcsql.com.  Having written the code, I'd agree with the "nasty"
and "time consuming" adjectives, but not so much the "risky" since all the
changes are done within a transaction and I also offer the option of
backing up the database before making any changes.



Pete
lcSQL Software <http://www.lcsql.com>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to