SqlRender performs substitution on strings of text but does not guarantee that its output will actually run on the desired dbms. This is because it does not check that it's input is valid OHDSI-SQL.
What if we thought of OHDSI-SQL as a sql dialect and formally defined it's structure so that we could
- Check that inputs are valid and can be translated
- Know that we have covered all translation cases when adding a new backend
- Potentially provide editor support for code completion and syntax checking using LSP
The definition would look something like

reference: https://duckdb.org/docs/sql/statements/select
SqlRender performs substitution on strings of text but does not guarantee that its output will actually run on the desired dbms. This is because it does not check that it's input is valid OHDSI-SQL.
What if we thought of OHDSI-SQL as a sql dialect and formally defined it's structure so that we could
The definition would look something like

reference: https://duckdb.org/docs/sql/statements/select