On Sun, 19 Aug 2007 23:33:35 +0900, Mario T. Lanza wrote:
How do I go about getting the “Comments” metadata–the one I type via
MySQL Administrator, for example–associated with a MySQL column?
I have been able to pull metadata from both ActiveRecord and DBI but
cannot seem to find this added bit of info.
This doesn’t appear to be implemented directily in MySQL’s C API.
Certainly it’s not implemented in the direct MySQL Ruby API (see http://
www.tmtm.org/en/mysql/ruby/ and have a look at fetch_fields and the
Mysql::Field class). Since DBD::Myql uses fetch_fields to determine what
metadata is available, it’s not available in dbi. I don’t know about
ActiveRecord, but I would expect the same thing.
The only way I know of to get this information is by running a “show
columns from TABLENAME” or using INFORMATION_SCHEMA. (Well, there’s
create table” too, but that requires parsing – why use that when you
have “show full columns”)