feat(postgres): add variable interpolation to postgres steps#141
Closed
alileza wants to merge 1 commit intotomatool:mainfrom
Closed
feat(postgres): add variable interpolation to postgres steps#141alileza wants to merge 1 commit intotomatool:mainfrom
alileza wants to merge 1 commit intotomatool:mainfrom
Conversation
Add {{variable}} interpolation support to postgres handler steps,
matching the behavior already present in the HTTP client handler.
Previously, variables captured via HTTP response steps (e.g. saved as
"{{cr_id}}") could not be used in postgres steps like "executes",
"table contains", or "table has values". This made it impossible to
cross-reference HTTP-created resources with direct database assertions.
Affected steps:
- "executes:" (raw SQL) — interpolates docstring content
- "table has values:" (insert) — interpolates cell values
- "table contains:" (assert) — interpolates expected cell values
Member
Author
|
Closing fork PR — reopening directly from org repo to fix CI permissions issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
{{variable}}interpolation support to postgres handler steps, matching the behavior already present in the HTTP client handlersaved as "{{cr_id}}") could not be used in postgres steps — this made it impossible to cross-reference HTTP-created resources with direct database assertionsWhat changed
Three postgres handler methods now call
ReplaceVariables()on their inputs:executeSQL— interpolates docstring content before executingsetTableValues— interpolates cell values when inserting rowstableShouldContain— interpolates expected cell values when assertingExample
This now works:
Test plan
go build ./...passes