These instructions specify steps for preparing your SQL query for inclusion in the canned reports or ad hoc reports sections of the cul-folio-analytics report repository on GitHub.


Review and Test

Each query requires one review and testing from a member of the reporting team to make sure it runs correctly and follows these specifications before it is submitted for inclusion in the repository.



Checklist

SQL queries must be conform to the requirements in the checklist before they are submitted for publication. The checklist also can be used to guide for the review of a query before it is submitted as a pull request.

  • Query runs without errors
  • Query output is correct
  • Query logic is clear and well documented
  • Query is readable and properly indented with spaces (not tabs)
  • Table and column names are in all-lowercase
  • Quotation marks are used only where necessary
  • Comments include who has reviewed query


The checklist below can be used to guide your review of a pull request (PR). A copy of the checklist may be added to a comment attached to a review. Check off the items that have been confirmed in your review by adding an x between the square brackets [] on each line.

If any items remain unchecked or you have further questions, you can indicate that in the comment as well and select "Request changes" as the review response.

All queries:
- [ ] PR Title and Description are accurate and thorough
- [ ] PR is based on a new branch (not main)
- [ ] PR scope is not overly broad
- [ ] Query runs without errors
- [ ] Query output is correct
- [ ] Query logic is clear and well documented
- [ ] Query is readable and properly indented with spaces (not tabs)
- [ ] Table and column names are in all-lowercase
- [ ] Quotation marks are used only where necessary

Report queries:
- [ ] Query has complete user documentation
    - [ ] Purpose of report
    - [ ] Sample output
    - [ ] Query instructions

Documenting your query

-each query needs a CR or AHR number

-name of query

-query reviewer, query writer

-date posted/updated

-short description of what query does



Related Resources 


https://github.com/folio-org/folio-analytics/blob/main/QUERIES.md 


https://github.com/folio-org/folio-analytics/blob/main/CONTRIBUTING.md 


https://sqlformat.darold.net/ 

  

  • No labels