Description
Audit explicit placeholder-name versus binding-name coverage, unused bindings and duplicate binding names; does not inspect values or execute SQL.
SQL identifiers, string literals and parameter placeholders serve different roles. Quote doubling can encode a single token in a selected dialect, while binding indexes connect placeholders to supplied values. These tools work with explicit tokens or lists; they do not connect to a database or parse an entire SQL program.
Audit explicit placeholder-name versus binding-name coverage, unused bindings and duplicate binding names; does not inspect values or execute SQL.
When to use this tool
Use this tool to audit explicit placeholder-name versus binding-name coverage, unused bindings and duplicate binding names; does not inspect values or execute SQL.
How to use the tool and how it works
- Enter names, bindings using the field definitions below.
- Run the operation. Correct input errors before interpreting an output.
- Read result.missing, result.unused, result.duplicateBindings. Use the ordering, boundary rules and absence conditions described below.
Compare placeholder names and binding names exactly. Return distinct missing and unused names in first-appearance order, plus duplicate binding groups.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| names | Placeholder names supplied without a marker prefix. | Dense list of at most 128 strings, each at most 8,192 UTF-16 code units. |
| bindings | Supplied binding-name strings. | Dense list of at most 128 strings, each at most 8,192 UTF-16 code units. |
| Output field | Interpretation |
|---|---|
| result | Object containing the named fields below. |
| result.missing | Missing one-based index gaps, or missing distinct binding names as described above. |
| result.unused | Unused binding indexes, or unused binding names in the named coverage operation. |
| result.duplicateBindings | Repeated supplied binding names with their original indexes. |
{
"input": {
"names": [
"a",
"b",
"a"
],
"bindings": [
"a",
"c"
]
},
"output": {
"result": {
"missing": [
"b"
],
"unused": [
"c"
],
"duplicateBindings": []
}
}
} Limitations and assumptions
- This checks names rather than bound values, SQL syntax or driver-specific case rules.
- Placeholder indexes are one-based when stated; occurrence positions and binding-list positions are zero-based. Supported quote styles are explicit local conventions rather than a promise of compatibility with every database dialect.
- Every declared top-level input field is required and unexpected fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and no larger in absolute magnitude than the safe-integer limit; operations returning exact large integers use decimal text. Positions are zero-based and spans end exclusively unless the operation explicitly states a different convention.
Alternative or Complementary methods
Use the database driver’s parameter binding for values and the target dialect’s identifier rules for names. Token formatting and occurrence audits are separate from execution, authorization and complete query validation.
References
Similar or alternative tools
- SQL Named Placeholder Name Audit
Audit already-extracted SQL named placeholder identifiers under a portable ASCII grammar and exact duplicate policy; no SQL lexical discovery or dialect claim.
- SQL Placeholder Occurrence Binding Map
Map explicit one-based numbered placeholder occurrences to zero-based binding slots and unused slots; repeated references intentionally reuse a binding.