# Database Document Viewer

The Database Document Viewer generates an HTML view of table documentation for a selected schema. It is a lightweight metadata viewer, not a general-purpose multi-format documentation generator.

## Open the Viewer

1. Connect to a database.
2. Open **Database -> Document Viewer**.
3. Select a schema from the list on the left.

The viewer loads the generated HTML in the main display area. The exact content depends on the database dialect and the metadata visible to the connected user.

## Refresh and Save

- Select another schema to generate/view its documentation.
- Use **Refresh** when the database structure changed externally, if the action is available in the current viewer state.
- Click **Save** to save the displayed HTML to a file.

The generated document may include table and column metadata, comments, and related definitions supported by the database document generator. It is generated from current metadata; it does not record historical schema changes.

## Cache Location

SQLife can cache generated documentation according to the database-document location configured in Preferences. Use **Preferences -> Database -> Document Location** to review or change that location.

## Limitations

The current desktop viewer does not provide an output-format selector, PDF/DOCX/XLSX/Markdown generation, ER-diagram controls, template selection, an in-viewer search box, or a separate documentation export manager. Save the generated HTML and use a browser or external document tool if another format is required.

## Troubleshooting

- If a schema is missing, verify that the connection user can read its metadata.
- If the page is empty or stale, refresh the schema documentation.
- If saving fails, choose a writable destination and check disk space.
- For large schemas, generate one schema at a time and avoid unnecessary repeated refreshes.
