Sphinx extension for autodoc of SQL files.
Project description
Introduction
sphinx-sql is a Sphinx documentation extension for building documentation from SQL source files.
Having found nothing in the while that could help solve the db first problem, I’ve written sphinx-sql.
This implimentation is tested against Greenplum / Postgres, those are the databases I work with on a daily basis. If you want to extend functionality, have a quick look at the contrib section of this document.
Installation
Install from PyPI:
pip install sphinx-sql
Configuration
Configuring Sphinx
In your conf.py for Sphinx enable the extension:
extensions = [
'sphinx_sql.sphinx_sql',
]
Configure toctree
Create a new rst file (we’ll call it autosql.rst) and include it in your toc-tree.
.. toctree::
:maxdepth: 2
:caption: Navigation:
autosql
Configure rst
Add the directive with a relative path from your document build folder to the root of your SQL source in the autosql.rst file.
SQL Documentation
^^^^^^^^^^^^^^^^^
.. autosql::
:sqlsource: ../../SQL
Add SQL Comments
Key word groups:
FUNCTIONS:
/*
Parameters:
Name | Type | Description
Return: Void
Purpose:
Detailed explanation of the function which includes:
- Function business logic
- Transformation rules
- Here is a bit more text.
Dependent Objects:
Type |Name
Table |schema_name.source_table5
View |schema_name.target_table6
ChangeLog:
Date | Author | Ticket | Modification
YYYY-MM-DD | Developer name | T-223 | Short Modification details or some really long text that will continue on.
*/
TABLES/VIEWS/etc:
/*
Purpose:
This a new view to show how auto documentation can add new obejcts quickly.
Dependent Objects:
Type |Name
Table |schema1.ext_table
ChangeLog:
Date | Author | Ticket | Modification
2020-10-26 | Developer_2 | T-220 | Initial Definition
*/
DML:
/*
Object Name: <schema.name>
Object Type: DML
Purpose:
This a new view to show how auto documentation can add new obejcts quickly.
ChangeLog:
Date | Author | Ticket | Modification
2020-10-26 | Developer_2 | T-220 | Initial Definition
*/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinx-sql-1.1.0.tar.gz.
File metadata
- Download URL: sphinx-sql-1.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8a27db8884bf570ea5452630bf9fd0bc3069b61b1779902c39b0e988603f1ac
|
|
| MD5 |
9185de5bd49a9d5704cd4509cc95be61
|
|
| BLAKE2b-256 |
677b2e0d8c22ad099f5f25d58d9ee2f03a9747b8faebc30db510dc25fa418662
|
File details
Details for the file sphinx_sql-1.1.0-py3-none-any.whl.
File metadata
- Download URL: sphinx_sql-1.1.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ee069d463dd34787484b0edaad1306831e9d1f6c9a29b07099fbcf2043af631
|
|
| MD5 |
9d09d82798a1dd9822bb8e4e5f17a158
|
|
| BLAKE2b-256 |
7fed03bfcc2e289d30e28204f05014d3de1866c1794ba74b50838a86f11ac50d
|