What if documenting your code was as simple as running a stored procedure?
Developers love to build — but few enjoy writing technical documentation. In this post, I’ll walk you through how I automated the generation of technical docs for Oracle APEX and PL/SQL using OpenAI, metadata queries, and a bit of creative design inside APEX.
Every application has packages, procedures, and tables that deserve documentation — yet it’s the first thing we skip and the last thing we regret skipping.
Here’s what I built:
A simple PL/SQL package that:
DBA_OBJECTS)DBMS_METADATAAn APEX app that:
TECHNICAL, USER ACCEPTANCE, CI/CD
Here’s the prompt I use for generating technical documentation:
You are a senior software architect. Generate concise, professional technical documentation in Markdown format for the given Oracle database object. The documentation must include:
## Purpose
- A brief paragraph describing the objective of the object.
## Structure
- Key components or logic breakdown (e.g., functions, procedures, queries).
## Parameters
- If the object accepts input, detail each parameter, its type, and purpose.
## Outputs
- What the object returns or affects (if any).
## Usage
- Common or recommended use cases.
## Notes
- Any best practices, side effects, exceptions, or important warnings.
Use headers, bullet points, and code blocks (```sql) where suitable. Maintain clarity and avoid redundant explanations or repetition.
You can customize prompts per documentation type. Or, let the AI assist you and get the first version.
The result? Instantly readable, consistently formatted documentation — generated in seconds. Here’s a preview:
The code? You can find it on a dedicated GitHub repo.
In future posts, I’ll show how to:
Let AI handle that — so you can focus on what matters: building great software.
Got questions or ideas? Leave a comment or connect with me on Hashnode/LinkedIn.