Skip to content

Implement JIT query rendering to avoid rendering unused templates#6

Merged
jeffreyaven merged 1 commit intomainfrom
claude/rust-stackql-deploy-port-xyr7K
Feb 12, 2026
Merged

Implement JIT query rendering to avoid rendering unused templates#6
jeffreyaven merged 1 commit intomainfrom
claude/rust-stackql-deploy-port-xyr7K

Conversation

@jeffreyaven
Copy link
Contributor

Previously, get_queries() rendered ALL query templates upfront (exists, create, update, delete, exports, etc.) regardless of which operation was being run. This caused failures when a template referenced variables not yet available in the context - e.g., a delete query referencing an export variable (databricks_credentials_id) that only gets populated after the exports query runs.

Changed to JIT (just-in-time) rendering:

  • get_queries() now only loads and parses templates without rendering
  • ParsedQuery stores the raw template instead of a pre-rendered string
  • Each command (build, teardown, test) renders templates on demand via render_query() only when the query is actually needed
  • Added render_query() to CommandRunner for convenient JIT rendering

This matches how the Python version works in practice - Jinja2 is more forgiving with missing variables, but the proper fix is to only render what you need, when you need it.

https://claude.ai/code/session_01ShAyjRLWBYC3tPsusCxggv

Previously, get_queries() rendered ALL query templates upfront (exists,
create, update, delete, exports, etc.) regardless of which operation was
being run. This caused failures when a template referenced variables not
yet available in the context - e.g., a delete query referencing an
export variable (databricks_credentials_id) that only gets populated
after the exports query runs.

Changed to JIT (just-in-time) rendering:
- get_queries() now only loads and parses templates without rendering
- ParsedQuery stores the raw template instead of a pre-rendered string
- Each command (build, teardown, test) renders templates on demand via
  render_query() only when the query is actually needed
- Added render_query() to CommandRunner for convenient JIT rendering

This matches how the Python version works in practice - Jinja2 is more
forgiving with missing variables, but the proper fix is to only render
what you need, when you need it.

https://claude.ai/code/session_01ShAyjRLWBYC3tPsusCxggv
@jeffreyaven jeffreyaven merged commit 7f06832 into main Feb 12, 2026
3 of 4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants

Comments