Skip to main content

Generate HTML documentation from SQL queries

Project description

Logo SQL Docs


SQL Docs is a framework designed to standardize SQL query documentation. Its goal is to provide a clear and consistent structure that facilitates readability, maintenance, and the automatic generation of documentation in HTML.


🎯 Objective

The framework is divided into 7 sections:

  • Sections 1 to 5 must be completed before writing the SQL query.
  • Sections 6 and 7 accompany the writing of the query, describing its different parts.

📑 Framework Structure

  • 1- Summary → Summary of the purpose of the query.
  • 2- Related Programs → Related queries.
  • 3- Sources → Data sources used.
  • 4- Products → Result of the query (table, view, insert, etc.).
  • 5- Historical Versions → Change log.
  • 6- Steps → Step-by-step comments and explanations of the process.
  • 7- Notes (NT) → Additional observations about the query.

⚠️ Important Notes

  • It is mandatory to follow the framework’s wording to allow for the subsequent automatic generation of HTML.
  • Sections can be omitted depending on project needs (this does not affect HTML export).
  • Each section must begin and end with the correct syntax.

📑 Details of each framework section:

  • Summary: Brief summary of the purpose of the query. Created Date: xx/xx/xxxx Description: Technical/functional details about the operation of the query. References: E.g., ticket or issue number.

  • Related Programs: List of other processes related to the query (e.g., other queries, PY files, processes, dashboards, etc.). Program: For example a query name.

  • Sources: This section details each of the consumed data sources. source_1 source_2 source_3

  • Product 1: Here you describe each of the products generated by the query, such as a table, view, insert, etc. Description: Brief description of the product. Name: Table/view name. Type: Table/View/Insert/Update/Delete. Process: Create or Replace / Truncate / etc.

  • Historical Versions: A record of changes made to the query. Date -(User)- Description of the change. 01/01/2025-(john.doe)- Initial creation. 15/01/2025-(jane.smith)- Filter adjustment.

  • Step 1: Short comment of the logic applied in the query. Used to divide it into stages, explaining the goal of each part of the process.

  • NT: Special comments that apply to specific lines of the query, relevant for understanding the process.


📑 HTML Example:

alt text


📑 Framework to copy:


/* SUMMARY */

-- name: example_name -- created_date: 2025-01-01 -- description: example description -- references: Ticket 1234

/* RELATED PROGRAMS */

-- - Example.sql -- - Example.sql

/* SOURCES */

-- - example.example.source -- - prod_bronze.mktinfo.cotizacion_vt7

/* PRODUCTS */

-- - name: example_name -- type: table -- description: example description -- process: create or replace

-- - name: example_name -- type: table -- description: example description -- process: create or replace

/* HISTORICAL VERSIONS */

-- - date: 2025-01-01 -- user: Example User -- description: created query

-- - date: 2025-01-01 -- user: Example User -- description: created query

/* PROCESS COMMENTS */

-- STEP 1: use this for explain the main process -- STEP 2: use this for explain the main process -- STEP 3: use this for explain the main process -- LC: Use this espace for specials lines coments


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sqldocs-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqldocs-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file sqldocs-0.1.0.tar.gz.

File metadata

  • Download URL: sqldocs-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for sqldocs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 877cb343fb2cae1cfba72c9f6e7198d1fd45e301b781146e18567cfdedacbf61
MD5 c07d8566249a67b40f709d16c8e5fa6f
BLAKE2b-256 4477384fd1343c3bdbe36628952569c89f814b34094edba36b7e24c57f4cf3a3

See more details on using hashes here.

File details

Details for the file sqldocs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sqldocs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for sqldocs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff4ef3f864db3e7d73bb74486fcfef18d6272b6fa8f50de2bc8072e107d70428
MD5 ed666c61b8fa1550f2e303f4e6c8ec96
BLAKE2b-256 d26e4fa18106e352947addf85a1172eccd4513d149935374a385c57d64934ec1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page