You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The .md spec used in the repo and described here https://github.com/OHDSI/QueryLibrary/blob/master/vignettes/UsingQueryLibrary.Rmd is straight forward and enables a lot of use cases. I think a small extension to the spec that allowed for a query to define "CTEs" (SQL 'with' clauses) would make it possible to use the .md to document even very complex queries such as the ones described in #29 . If this is within the vision for this repo then I could draft an extension to support CTEs that uses the existing anchor tags in the .md to allow for simple navigation of the .md on github.
The text was updated successfully, but these errors were encountered:
natb1
changed the title
"CTE" extension of the .md spec
"CTE" extension to the .md spec
Feb 29, 2024
The CTE section of the QueryLibrary markdown documents
allow queries to reference common subqueries. This
way, even very complex queries can be represented
in the query library:
Large queries can be decomposed into smaller queries.
Queries that rely on features that vary between dialects
can be isolated into subqueries.
CTEs are a markdown list of markdown anchor tags ("links").
The text of the anchor is the SQL alias used in the query
and the anchor refers to the URL of any other
QueryLibrary document.
SELECTcount(*) as person_count FROM person
-- CTEs can be used to decompose queries.INNER JOIN female USING gender_concept_id
-- Or, to isolate logic from different dialects.JOIN age USING person_id
WHERE age >18
The .md spec used in the repo and described here https://github.com/OHDSI/QueryLibrary/blob/master/vignettes/UsingQueryLibrary.Rmd is straight forward and enables a lot of use cases. I think a small extension to the spec that allowed for a query to define "CTEs" (SQL 'with' clauses) would make it possible to use the .md to document even very complex queries such as the ones described in #29 . If this is within the vision for this repo then I could draft an extension to support CTEs that uses the existing anchor tags in the .md to allow for simple navigation of the .md on github.
The text was updated successfully, but these errors were encountered: