Export database structure 关注 已回答 yansem 创建于 2023年03月23日 08:03 Is there a way to export only the structure of database tables, for example, to HTML?Similar to how phpMyAdmin or adminer does it.
Yes, PhpStorm provides a way to export the structure of database tables. You can use the "Export Database Schema" feature to achieve this. Here are the steps:
Once the process is completed, you can open the exported HTML file to view the database structure.
I hope this helps. Let me know if you have any further questions.
Unfortunately, I don't see "Export Database Schema" in my context menu. Can this be affected by the version of PhpStorm (current 2022.3.2), or the database (MariaDB 10.5.18)? There is only "Import/Export", but I didn't find the right one here either.
Sorry, misplaced the options.
There are two ways:
1. In context menu Diagrams | Show Visualisations. The diagram can later be exported to PlantUML/Meramid, but not to HTML:
2. In context menu click "SQL scipts | Copy DDL to Clipboard". DDL is not HTML, but contains all the info about table/database as a text.
3. There is a way to create a custom exporter, but it's a bit complex
Can you share your use case? Why HTML is needed?
It is the tabular representation that is more important, as it seems to me, it is more convenient for perception, and is required in technical documents. And whether it will be HTML or CSV is not so important.
Right now I'm using "Generate DLL" and then inserting it into Adminer to get the table.
Thank you for your response, I will think about custom exporter.