Skip to content

Support multi-value parameters in the generated defaultDataAccess #253

Description

@GregorioBlazquez

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions