Skip to content

Use helper methods to create IN clauses - #8187

Merged
labkey-adam merged 11 commits into
developfrom
fb_cleaner_in_clauses
Oct 17, 2026
Merged

labkey-adam merged 11 commits into
developfrom
fb_cleaner_in_clauses

Conversation

@labkey-adam

@labkey-adam labkey-adam commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

Using helpers to generate SQL IN clauses is more convenient and prevents broken SQL & injection risks. It also allows optimizations such as ANY(?) and temp table IN clauses.

Changes

  • Fix TempTableInClauseGenerator so it handles collections of Container, User, and other classes that implement JdbcParameterValue
  • Replace some String and StringBuilder concatenation with SQLFragment
  • Use SQLFragment.appendInClause() where possible
  • Introduce a SQLFragment.appendInClause() variant that takes a column expression. Passing in the column allows us to generate a clause acts as expected when preceded by NOT. Add SQLFragment.appendNotInClause() for convenience.
  • Assert that NOT doesn't precede an IN clause that isn't safe for negating
  • (Unrelated) Migrate away from deprecated StringUtils methods

Tasks

  • Claude Code Review
  • Code Review
  • TeamCity Review and Merge

@labkey-adam labkey-adam self-assigned this Oct 16, 2026
@labkey-adam labkey-adam added this to the 26.11 milestone Oct 16, 2026
Comment thread query/src/org/labkey/query/sql/Method.java Outdated
@labkey-matthewb
labkey-matthewb self-requested a review October 16, 2026 23:52

@labkey-matthewb labkey-matthewb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth getting this multi-repo PR merged and then addressing Method.java

@labkey-adam
labkey-adam merged commit 67e8bad into develop Oct 17, 2026
9 checks passed
@labkey-adam
labkey-adam deleted the fb_cleaner_in_clauses branch October 17, 2026 17:54
labkey-adam added a commit to LabKey/onprcEHRModules that referenced this pull request Oct 17, 2026
## Rationale
Using helpers to generate SQL IN clauses is more convenient and prevents
broken SQL & injection risks

## Related Pull Requests
- LabKey/platform#8187
labkey-adam added a commit to LabKey/commonAssays that referenced this pull request Oct 17, 2026
## Rationale
Using helpers to generate SQL IN clauses is more convenient and prevents
broken SQL & injection risks

## Related Pull Requests
- LabKey/platform#8187
labkey-adam added a commit to LabKey/customModules that referenced this pull request Oct 17, 2026
## Rationale
Using helpers to generate SQL IN clauses is more convenient and prevents
broken SQL & injection risks

## Related Pull Requests
- LabKey/platform#8187
labkey-adam added a commit to LabKey/OConnorLabModules that referenced this pull request Oct 17, 2026
## Rationale
Using helpers to generate SQL IN clauses is more convenient and prevents
broken SQL & injection risks

## Related Pull Requests
- LabKey/platform#8187
labkey-adam added a commit to LabKey/MacCossLabModules that referenced this pull request Oct 17, 2026
## Rationale
Using helpers to generate SQL IN clauses is more convenient and prevents
broken SQL & injection risks

## Related Pull Requests
- LabKey/platform#8187
labkey-adam added a commit to LabKey/targetedms that referenced this pull request Oct 17, 2026
## Rationale
Using helpers to generate SQL IN clauses is more convenient and prevents
broken SQL & injection risks

## Related Pull Requests
- LabKey/platform#8187
labkey-adam added a commit to LabKey/DiscvrLabKeyModules that referenced this pull request Oct 17, 2026
## Rationale
Using helpers to generate SQL IN clauses is more convenient and prevents
broken SQL & injection risks

## Related Pull Requests
- LabKey/platform#8187
labkey-adam added a commit to LabKey/snprcEHRModules that referenced this pull request Oct 17, 2026
## Rationale
Using helpers to generate SQL IN clauses is more convenient and prevents
broken SQL & injection risks

## Related Pull Requests
- LabKey/platform#8187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants