michael_morris1 — 2012-07-05T09:15:16-04:00 — #1
I literally had this idea 30 seconds ago - why not use the MySQL comments to store a serialized array that contains additional meta data for the column - at the very least the name of the table the column is a foreign key for, stuff like that.
Has this been done? What would be the ramifications, other than condensing where the meta information is stored. My own initial reaction to the idea is it's crazy - but maybe crazy enough to actually work.
[A little further research - there's a 60 character limit]
system — 2012-07-05T10:56:16-04:00 — #2
Any database has catalogs for this type of metadata.
I believe in MySQL information_schema covers that?
r937 — 2012-07-05T15:13:44-04:00 — #3
michael_morris1 — 2012-07-06T07:01:02-04:00 — #4
The information schema does cover that - and its where the comments are ultimately stored. But I have additional meta data in the system I'm building. One of the more critical pieces is the governing class for the table or field, which informs the primary model which class should be loaded to handle the table's data. Also, MySQL doesn't store relationships. It's possible to infer them through proper field naming, but they are explicitly named.
The convention I'm developing has the limitation that no field and no table can share a name arbitrarily. When the system encounters a field that has the same name as a table, it presumes the field is a foreign key for that table.
I suppose I should go back to having my own meta tables for this information.
r937 — 2012-07-06T07:16:55-04:00 — #5
what about the KEY_COLUMN_USAGE table?
mittineague — 2014-09-22T11:34:38-04:00 — #6
This topic is now archived. It is frozen and cannot be changed in any way.