Column Comments used for data (in mysql 5)
Posted: Thu Feb 14, 2008 9:24 am
I know that its non-standard practice, but what are the pros/cons about using a comment on a column to contain data that is queried and used as display information in an application. This design could potentially save valuable development time as we customize our application for several clients with different needs. A thread on the mysql board asks if its possible,
Basic example of usage in the application:
Nick Weavers wrote:I was wondering if I could use table and column comments to store "metadata".
I would like to know if this practice should be avoided for any specific reasons (some characters not allowed or too much overhead on the db for instance) or if it is a decent approach or Should a relation table of "labels" be created to address this issue properly? (DBA's please throw your 2 cents in =D)David Ashman's Response wrote:Just seems wrong to try and hack comment usage for actual data you want to use... in a database made to store data in the first place.
Basic example of usage in the application:
Code: Select all
loop of all queried col names and comments
{
label (comment): form input (col name)
}