brittneybrinsfield / sequel-pro

Automatically exported from code.google.com/p/sequel-pro
Other
0 stars 0 forks source link

[REQ] Infer column type from column name for new columns #1419

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've been using Sequel Pro for a long time, and one repetitive task I find 
myself doing quite often is setting the column time for a column named 
'timestamp.'

What I am proposing is having the column get automatically set to 'TIMESTAMP' 
when you create a column named 'timestamp.'  I've, personally, never come 
across a situation where a column I named 'timestamp' required a different 
datatype. 

This would save some time for people like me who create tables in batches, and 
have applications that use timestamps heavily. 

Thanks for your time,

David

Original issue reported on code.google.com by da...@delcoe.com on 9 Aug 2012 at 3:17

GoogleCodeExporter commented 9 years ago
Well "timestamp" could also mean a UNIX timestamp which would be an INT.

But indeed it would be no harm if we would guess some datatypes from column 
names for new columns.

What conventions are there though?

Original comment by schlabbe...@gmail.com on 9 Aug 2012 at 9:02

GoogleCodeExporter commented 9 years ago
Well, you could potentially do it for all of the various date/time-related 
datatypes. DATE, DATETIME, and TIMESTAMP. 

I'm trying to think of any other sure-fire datatype predictions. Columns named 
'name' or 'username' or 'email almost always go to VARCHAR or TINYTEXT. 

What else?

Original comment by da...@delcoe.com on 9 Aug 2012 at 9:25