The generated defaultDataAccess currently builds equality filters like:
WHERE ($param IS NULL OR column = $param)
This works for single values but not for comma-separated lists (e.g. value1,value2), which are treated as a single string instead of multiple values.
The FDA execution pipeline should not infer SQL semantics or rewrite user-defined queries. DAs are parameterized SQL queries, so authors should decide whether to use =, IN, LIKE, etc.
However, defaultDataAccess is generated by FDA itself, making it a good place to improve the default behavior.
Proposal
Generate equality filters using:
WHERE (
$param IS NULL OR
column IN (SELECT unnest(string_split($param, ',')))
)
This approach:
- Supports both single and multiple values transparently.
- Is fully backward compatible (
IN ('value') behaves like = 'value').
- Requires no changes to the execution pipeline (
applyParams, prepared statements, parameter binding, etc.).
- Makes the generated
defaultDataAccess more flexible while preserving the current SQL contract for custom DAs.
The generated
defaultDataAccesscurrently builds equality filters like:This works for single values but not for comma-separated lists (e.g.
value1,value2), which are treated as a single string instead of multiple values.The FDA execution pipeline should not infer SQL semantics or rewrite user-defined queries. DAs are parameterized SQL queries, so authors should decide whether to use
=,IN,LIKE, etc.However,
defaultDataAccessis generated by FDA itself, making it a good place to improve the default behavior.Proposal
Generate equality filters using:
This approach:
IN ('value')behaves like= 'value').applyParams, prepared statements, parameter binding, etc.).defaultDataAccessmore flexible while preserving the current SQL contract for custom DAs.