On Dec 20, 2009, at 8:01 PM, Ilya Musabirov wrote: > Hi! > Is there any way to add sql comment on column in CREATE TABLE > statement? > > I use Infobright engine for MySQL and it has very useful feature > "lookup field"[1], but to use it I should declare column as > "<<column name>> <<column type>> … COMMENT ‘lookup’ …" > as a part of CREATE TABLE statement (and comment can not be added > later via ALTER statement). > > I'm using SA 0.6 and it does a good job when it comes to work with > DDL, but I can't find any way to make this simple task. > > Any suggestions and comments will be highly appreciated... > Thanks!
we have an initial patch for this feature in http://www.sqlalchemy.org/trac/ticket/1546 . it uses an ALTER since the poster of the ticket seemed to express this was the method accepted by Oracle. So for MySQL and maybe others it would need work to express the comments either as an ALTER or inline depending on dialect. So the patch needs work including acceptable methods for most/all of the backends as well as some tests that test round trips. reflection might be nice too. For an inline keyword on the column, the MySQL dialect at the least would need direct modification to support the feature, in the "get_colspec()" function - and it would probably want to ignore the AddTableComment/AddColumnComment constructs. > > [1] http://www.infobright.org/wiki/How_and_When_to_use_Lookups/ > > -- > > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
