开发者

Relying on table comments with MySQL

开发者 https://www.devze.com 2023-04-04 05:08 出处:网络
I\'m building an application that adds/removes/alters tables in a MySQL database. Some tables have specific application roles and need to be tagged and identified as such by the application. Can I dep

I'm building an application that adds/removes/alters tables in a MySQL database. Some tables have specific application roles and need to be tagged and identified as such by the application. Can I depend on table comments to reliably store this meta informa开发者_如何学Pythontion?


I have built code that uses table and column comments to hold meta information as you mention. It works very well.

My application was tagging particular tables and columns in a medical information system as needing to be concealed when exporting the data, to preserve patient confidentiality.

You do need to ensure that the comments get dumped along with other schema information when you save your schema (for example, to store the schema in your source control system).

I used capitalized keywords in the comments, to make it possible to also include real explanatory comments side by side with the metadata.

Go for it!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号