{"repo":"anelendata/dbt_docstring","free":true,"listed":false,"github":"https://github.com/anelendata/dbt_docstring","clone":"git clone https://github.com/anelendata/dbt_docstring.git","description":"Docstring dbt test & documentation in SQL file","language":"Python","stars":13,"topics":["dbt","analytics","documentation","sql"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"dbt docstring Docstring dbt test & documentation in SQL file What is it? dbt has a test and documentation feature where models/schema.yml is the definition file. While this is already a big help for testing and documentation in ELT, not being able to keep documentation in the source code may cause more documentats out of sync with the source. dbtdocstr lets you write docment in a docstring style directly in .sql files. Install How does it work? dbtdocstr command scans .sql files under dbt's models directories and look for a block that begins with dbt . Inside the block you can write the content of the models section of schema.yml corresponding to the current table as specified in dbt document: Example ( /models/api key status.sql) dbt columns: - name: api key description: API key tests: - unique - name: enabled description: True if API key is enabled status - name: update datetime description: Last update date and time Then run: These two files will be auto-generated from each .sql file in the dbt project: models/docs.md : models/schema.yml : To see the document generation, use dbt command: Notes - The doc must be a SQL comment block comment that begins with '/\\ ' and ends with '\\ /' - The first comment block will be extracted. - The dbt block is searched within the first comment block. - Any text after the dbt block will be ignored. - dbt's Docs Blocks feature can be used only for table & view description. Not column descriptions. - dbtdocstr --backup to create backup files ","default_branch":null,"files":null,"tree":[],"storefront":"/r/anelendata","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/anelendata/dbt_docstring/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}