How to Generate Snowflake Database Documentation with DbSchema
Introduction
This tutorial will show you how to quickly generate documentation for your Snowflake database using DbSchema. It will cover creating and exporting an interactive Data Dictionary in HTML5 or PDF, including tables, foreign keys, views, stored procedures, and more.
1. Get Ready
Before generating documentation, follow these steps:
- Download DbSchema from here (available for Windows, macOS, and Linux).
- Install DbSchema and launch the application.
- Get a free trial key of 30 days to unlock HTML5 export, ER diagrams, and collaboration features.
2. Connect to Your Snowflake Database
To start documenting your Snowflake database, you need to connect DbSchema to Snowflake.
Open DbSchema and Select Snowflake as Your Database Type
Start by opening DbSchema and selecting Snowflake from the list of available database types.Enter Your Snowflake Connection Details
Provide your Snowflake connection details, which include:- Account URL
- Username (mandatory)
- Password (mandatory)
Optionally, you can specify the database, warehouse, schema, and role to customize your connection.
For a complete guide on how to connect DbSchema to Snowflake, read this documentation.
Click “Connect” & Select the Schema
After entering the necessary details, click Connect to establish the connection. You will then be prompted to select the schema you wish to import.DbSchema Will Retrieve Your Schema
Once connected, DbSchema will retrieve the structure of your database, including tables, columns, foreign keys, stored procedures, triggers, and more.
3. Documentation Overview
Once connected, you can explore your database schema in DbSchema’s interactive UI. The documentation will include:
- Tables and Columns
- Relationships (Foreign Keys)
- Views and Stored Procedures
- Indexes and Constraints
- Custom Metadata (tags, comments, annotations, etc.)
You can edit descriptions and metadata directly in DbSchema to improve the documentation quality.
4. Export to Interactive HTML5
When documenting a Snowflake schema in DbSchema, exporting to HTML5 is the recommended option. The HTML5 format enables interactive navigation and easy searching, providing a user-friendly experience for your team and stakeholders.
Steps to Export HTML5 Documentation
Click on “Export Documentation”
Navigate to ‘Diagram’ -> ‘Export Documentation’ within DbSchema.Choose “HTML5” as the Format
Select “HTML5” to generate interactive documentation viewable in any modern browser.Select the Content to Include
Choose which elements of your schema to include in the documentation (e.g., Tables, Views, Foreign Keys, etc.).Choose the File Path
Select the directory where you want the HTML documentation to be saved.Click “Generate”
Once set, click “Generate” to create an interactive HTML5 file for sharing and viewing.
Automate Documentation with Java Groovy Scripts
For teams that need to automate the documentation generation process, you can use Java Groovy Scripts to generate HTML5 documentation. This ensures consistency and saves time.
Sample HTML Export
Here’s a sample of what the interactive HTML export looks like:
- Interactive Navigation: Collapsible sections for easy schema navigation.
- Search Functionality: Built-in search to quickly find specific tables or relationships.
- Responsive Design: Optimized for both desktop and mobile viewing.
To explore a sample of our interactive database diagram, click the button below.
5. Export to PDF
If you prefer a static format or need a printable version of your documentation, exporting to PDF is an excellent choice. While PDF documentation lacks the interactivity of HTML5, it offers a clear and shareable format suitable for offline access and printing.
Steps to Export PDF Documentation
Click on “Export Documentation”
Start the export by navigating to “Export Documentation” in DbSchema.Choose “PDF” as the Format
Select the “PDF” option from the export menu.Select the Content to Include
Choose which elements to include in your PDF.Choose the File Path
Select where you want to save the PDF.Click “Generate”
Click “Generate” to create your PDF documentation.
Sample PDF Export
Although the PDF version is not interactive, it will contain a detailed, static overview of your schema. You can use the exported PDF for offline sharing, printing, or distributing to those who don’t need interactive features.
Download a Sample PDF
6. Keeping Documentation Up to Date
DbSchema makes it easy to keep your documentation up-to-date through automatic schema comparison and Git integration. These features help you:
- Detect changes in the database schema
- Highlight differences between versions
- Update the documentation automatically
- Use Git for versioning your documentation, ensuring that team members can track changes and collaborate effectively.
Conclusion
DbSchema provides a powerful, automated way to document your Snowflake database. With interactive HTML5 and PDF exports, you can easily share, navigate, and maintain your database documentation.
Try DbSchema today and start generating your Snowflake documentation!