Re: [sqlite] Need to be able to rename attributes

2011-05-16 Thread Nico Williams
On Mon, May 16, 2011 at 1:29 PM, Simon Slavin wrote: > Yet strangely, the ability to obtain the statements used to create the schema > is something I find very useful in quite a few utilities.  If you could > depend on them being in a standard format they'd be even more useful. I like the fact

Re: [sqlite] Need to be able to rename attributes

2011-05-16 Thread Simon Slavin
On 16 May 2011, at 7:18pm, Jay A. Kreibich wrote: > I think the bigger issue is that column rename requires full > understanding of the SQL statements stored in sqlite_master. To > safely do a ALTER TABLE...RENAME COLUMN you have to understand the > context and parts of the CREATE TABLE stat

Re: [sqlite] Need to be able to rename attributes

2011-05-16 Thread Nico Williams
On Mon, May 16, 2011 at 1:18 PM, Jay A. Kreibich wrote: > On Mon, May 16, 2011 at 12:49:14PM -0500, Nico Williams scratched on the wall: >> Nit: that's almost certainly the reason that SQLite3 doesn't support >> column rename, > >  I think the bigger issue is that column rename requires full >  un

Re: [sqlite] Need to be able to rename attributes

2011-05-16 Thread Jay A. Kreibich
On Mon, May 16, 2011 at 12:49:14PM -0500, Nico Williams scratched on the wall: > On May 16, 2011 9:33 AM, "Simon Slavin" wrote: > > On 16 May 2011, at 3:44am, romtek wrote: > > > > > Secondly, if I executed the above SQL code, what would happen to > triggers, > > > etc. that are associated with th

Re: [sqlite] Need to be able to rename attributes

2011-05-16 Thread Nico Williams
On May 16, 2011 9:33 AM, "Simon Slavin" wrote: > On 16 May 2011, at 3:44am, romtek wrote: > > > Secondly, if I executed the above SQL code, what would happen to triggers, > > etc. that are associated with the original table? > > I suspect that's a major reason why SQLite doesn't support DROP COLUM

Re: [sqlite] Need to be able to rename attributes

2011-05-16 Thread Simon Slavin
On 16 May 2011, at 3:44am, romtek wrote: > Secondly, if I executed the above SQL code, what would happen to triggers, > etc. that are associated with the original table? I suspect that's a major reason why SQLite doesn't support DROP COLUMN: it has to check for things that might depend on the c

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/15/2011 08:49 PM, romtek wrote: > I don't know about how things work in your world, but in mine requirements > for apps change sometimes, so I have to enter design stage after an app (may > be a website) has been released. Perhaps, you are a clai

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Nico Williams
It's perfectly fair to ask for a feature. And ALTER TABLE rename column support is a well justified feature to want, IMO; I don't blame you for wanting it. Whether it will be added, or when, I'd not know. The dev team (whom I do not speak for) has its priorities, and its paying customers to worry

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Mr. Puneet Kishor
On May 15, 2011, at 10:49 PM, romtek wrote: > Let's not make this issue into something that it's > not. Let's not. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread romtek
On Sun, May 15, 2011 at 10:00 PM, Roger Binns wrote: > On 05/15/2011 07:48 PM, romtek wrote: > > I was describing what I have to do during design time, which often > happens > > after a website has been launched and is operational. > > Huh? You launch and have a site in production and then you d

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread romtek
On Sun, May 15, 2011 at 10:05 PM, Nico Williams wrote: > Right, well, SQLite3 doesn't support renaming columns. Internally > SQLite3 only stores the CREATE statements for all schema elements > (plus actual b-trees for tables and indexes). Specifically SQLite3 > does not store schema elements in

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread romtek
On Sun, May 15, 2011 at 5:22 PM, Simon Slavin wrote: > Yeah, you have to fake it by making a new table. You want support for more > ALTER TABLE variants. The proper way to do it would be to > > ALTER TABLE myTable ADD COLUMN dateAdded > UPDATE myTable SET dateAdded = date > ALTER TABLE myTable

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Nico Williams
On Sun, May 15, 2011 at 9:44 PM, romtek wrote: > On Sun, May 15, 2011 at 5:10 PM, Mr. Puneet Kishor wrote: >> > I want to rename date to dateAdded. >> >> sqlite doesn't support changing the name of a table column (and, neither >> you nor your user should be doing this -- there is something strange

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/15/2011 07:48 PM, romtek wrote: > I was describing what I have to do during design time, which often happens > after a website has been launched and is operational. Huh? You launch and have a site in production and then you design it? > I som

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Mr. Puneet Kishor
On May 15, 2011, at 9:44 PM, romtek wrote: > An analogy: if > I want to create a letter with pretty styles and maybe images, I will use MS > Word or, at least, Open Office. I will not write a program to do that :) Wrong analogy above. The correct analogy would be, if you had to modify MS Word

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread romtek
On Sun, May 15, 2011 at 5:27 PM, Roger Binns wrote: > Wanting to rename a column should be a rare thing since it is so rare. If > you are frequently renaming columns then your code will be very brittle. > > I was describing what I have to do during design time, which often happens after a websit

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread romtek
On Sun, May 15, 2011 at 5:10 PM, Mr. Puneet Kishor wrote: > > > A table: > > > > id, eventName, date > > > > I want to rename date to dateAdded. > > > > > sqlite doesn't support changing the name of a table column (and, neither > you nor your user should be doing this -- there is something strange

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Jay A. Kreibich
On Sun, May 15, 2011 at 10:39:22PM +0100, Simon Slavin scratched on the wall: > > On 15 May 2011, at 10:33pm, romtek wrote: > > So, I am asking developers of SQLite to make it easy for tool developers to > > offer the ability to rename attributes. > > The SQL specification does not use the term '

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Wolfgang Enzinger
Am Sun, 15 May 2011 17:10:53 -0500 schrieb Mr. Puneet Kishor: > sqlite doesn't support changing the name of a table column (and, neither you > nor > your user should be doing this -- there is something strange with your app >requirements). That said, you can "rename" a column by creating a new ta

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/15/2011 03:05 PM, romtek wrote: > I want to rename date to dateAdded. > > People currently jump through hoops in order to achieve such a simple (from > the user's point of view) and needed goal: > http://stackoverflow.com/questions/805363/how-do

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Simon Slavin
On 15 May 2011, at 11:05pm, romtek wrote: > I will give you an example, and you correct my use of the terms, please. > > A table: > > id, eventName, date > > I want to rename date to dateAdded. Okay, that's a column name, and you want the ability to rename columns. > People currently jump th

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Mr. Puneet Kishor
On May 15, 2011, at 5:05 PM, romtek wrote: > On Sun, May 15, 2011 at 4:39 PM, Simon Slavin wrote: > >> >> On 15 May 2011, at 10:33pm, romtek wrote: >> >>> So, I am asking developers of SQLite to make it easy for tool developers >> to >>> offer the ability to rename attributes. >> >> The SQL

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread romtek
On Sun, May 15, 2011 at 4:39 PM, Simon Slavin wrote: > > On 15 May 2011, at 10:33pm, romtek wrote: > > > So, I am asking developers of SQLite to make it easy for tool developers > to > > offer the ability to rename attributes. > > The SQL specification does not use the term 'attribute' in any way

Re: [sqlite] Need to be able to rename attributes

2011-05-15 Thread Simon Slavin
On 15 May 2011, at 10:33pm, romtek wrote: > So, I am asking developers of SQLite to make it easy for tool developers to > offer the ability to rename attributes. The SQL specification does not use the term 'attribute' in any way that would give them names. Can you explain what you mean by 'ren

[sqlite] Need to be able to rename attributes

2011-05-15 Thread romtek
Hi, SQLite probably was intended as an embedded database for standalone software. However, because of its promotion by PHP community, it's been used to power websites. I use it for that purpose too and prefer it over other SQL DB solutions (primary because it allows me to move/backup data from a s