Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider supporting parameterized queries #72

Open
iaindillingham opened this issue Feb 10, 2023 · 1 comment
Open

Consider supporting parameterized queries #72

iaindillingham opened this issue Feb 10, 2023 · 1 comment

Comments

@iaindillingham
Copy link
Member

opensafely/winter-pressures could benefit from a parameterized query, to move the values of @study_start_date and @study_end_date into project.yaml.

iaindillingham added a commit to opensafely/tpp-database-history that referenced this issue Apr 17, 2023
We move the initialisation of `FROM_DATE` and `TO_DATE` from deep within
`render_report` to `config`, to make them more visible and to highlight
the redundancy -- their canonical values are available within
*analysis/query.sql* (former) and at runtime (latter). SQL Runner
doesn't accept parametrised queries [1] -- and even if it did, we'd
still have redundancy in *project.yaml* -- and the date and time an
upstream SQL Runner action was executed is not accessible to downstream
actions [2], so the best we can do to prevent drift between the `query`
action and the `render_report` action is to highlight the redundancy.

[1]: opensafely-core/sqlrunner#72
[2]: opensafely-core/sqlrunner#86
@iaindillingham
Copy link
Member Author

Similarly, opensafely/ons-cis-short-data-report could use them such that we don't have to copy the same query each time we want to count the values in a categorical column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant