Repository navigation
S10: bind query parameters with -a NAME=VALUE - #39
Merged
Merged
Conversation
A value given with -a is bound to $NAME through the engine's Relix.Builder.parameters, never pasted into the script, so a value holding a quote cannot change the query. The value is text, which the engine reads as the type the parameter was analysed to (relix-core#101): -a id=42 binds a number when $id is compared with a NUMBER, and text that does not read as that type is an analysis error. An unbound parameter is an analysis error (exit 3) that names it. The engine's message names its Java remedy, so EngineMessages puts it in the command's terms: "give it a value with -a NAME=VALUE". fmt, bundle and optimize print $NAME, never the value. Part of #14.
This was referenced Oct 9, 2026
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.
S10 (#14), part of #17:
-a/--arg NAME=VALUEbinds the query parameter$NAMEoutside the script text.relix -a id=42 order.relix xargs -I{} relix -a id={} order.relixWhat it does
-ais repeatable and global, like-D, so it can come before or after the command and the script. Values go to the engine throughRelix.Builder.parametersand are never pasted into the text.-a id=42binds a number when$idis compared with a NUMBER column. Text that doesn't read as that type is an analysis error (exit 3) naming the parameter, the type and the text.EngineMessagesrewrites that one message for the command line:relix: order.relix: parameter $id is not bound; give it a value with -a id=VALUEEvery other engine message passes through unchanged.
fmt,bundleandoptimizeprint$name, never the value.docs/design.md§4 lists-a.Tests
QueryParametersTestcovers the issue's acceptance points throughMain:--arg, after the script, and several-aat once;Paris' ∨ '1' = '1, matches nothing and can't change the query;fmt,bundleandoptimizeprinting$cityand not the value.CI: the two
FmtTestfailures onleague.relixaren't caused by this branch; they fail ondeveloptoo. They clear once DarkCollective/relix-core#106 reaches the snapshot and #38 merges. Everything else passes.