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.2.tar.gz (9.2 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.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sqldocs-0.1.2.tar.gz
  • Upload date:
  • Size: 9.2 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.2.tar.gz
Algorithm Hash digest
SHA256 9763a0e105f55b9814029dd541855ef2f561a88dc412f711cc1d6063d59d07b8
MD5 29982706e6c798d2844e742d21934049
BLAKE2b-256 fc148431737b3b793192eb36a0627a8bd60ae5bc40ade7a1cce901ade20a1be1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sqldocs-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 431896a2689abbdb320ba3b35d3d9d47e6b46ed6cd7062f89dcc2c5105aa6568
MD5 58e37d6937426455029863d8635eceff
BLAKE2b-256 aebf236fd92c0390bc56896211ddb95ffafd0ebba375d7d42f661f8858e57ab3

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