You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Refactored queries to use parameterized statements for
`installation_id` and `repositories`
## Description
<!-- Describe your changes in detail -->
## Type of Change
<!-- Mark relevant items with an [x] -->
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation/Repository docs update
- [ ] Performance improvement
- [ ] Code refactoring
- [ ] Test updates
## Testing
<!-- How has this been tested? -->
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Not applicable
## Documentation
<!-- Mark relevant items with an [x] -->
- [ ] Documentation update required
- [ ] Changelog update required
## Related Issues
<!-- Link related issues below. Insert the issue link or issue number
-->
- Closes: <!-- insert issue link here -->
- Related to: <!-- insert issue link here -->
SET repositories = (SELECT to_jsonb(array_agg(DISTINCT b)) FROM (SELECT jsonb_array_elements_text(repositories || '#{sql_repositories}') as b FROM github_app_installations WHERE installation_id = '#{installation_id}') as c)
97
-
WHERE installation_id = #{installation_id}
95
+
SET repositories = (SELECT to_jsonb(array_agg(DISTINCT b)) FROM (SELECT jsonb_array_elements_text(repositories || $1::jsonb) AS b FROM github_app_installations WHERE installation_id = $2 ) AS c )
SET repositories = to_jsonb(array_diff((SELECT array_agg(trim(JsonString::text, '"')) FROM jsonb_array_elements(repositories) JsonString), array[#{sql_repositories}]))
114
-
WHERE installation_id = #{installation_id}
111
+
SET repositories = to_jsonb(array_diff((SELECT array_agg(trim(JsonString::text, '"')) FROM jsonb_array_elements(repositories) JsonString), $2::text[]))
0 commit comments