Skip to content

Prevent SQL injection by identifiers#129

Open
barbosa89 wants to merge 27 commits into
mainfrom
hotfix/security-improvements
Open

Prevent SQL injection by identifiers#129
barbosa89 wants to merge 27 commits into
mainfrom
hotfix/security-improvements

Conversation

@barbosa89
Copy link
Copy Markdown
Contributor

No description provided.

barbosa89 and others added 27 commits April 29, 2026 15:29
Co-authored-by: Copilot <copilot@github.com>
- Refactored ClauseBuilder to improve handling of where clauses and arguments.
- Updated BuildsQuery trait to utilize AST for managing query properties.
- Modified HasJoinClause and HasLock traits to store join and lock information in the AST.
- Improved HasWhereClause and HasWhereDateClause to push where clauses directly to the AST.
- Adjusted QueryBase to reset properties and manage AST effectively.
- Updated QueryGenerator to ensure driver and action are set in the AST.
- Enhanced tests to verify correct parameter handling and AST synchronization.
- Added normalization for placeholders in Postgres dialect.
- Implemented new tests to validate the integrity of query parameters across various scenarios.

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
- Updated ClauseCompiler interface to separate AST setting and compilation methods.
- Modified all compiler classes (Insert, Update, Delete, Select, Exists, etc.) to utilize the new AST handling.
- Removed redundant QueryAst parameters from compile methods.
- Ensured that all compilers now access the QueryAst through a protected method.
- Added tests to verify that compiler state does not leak between compilations.
- Replaced instances of Funct::count, Funct::sum, Funct::avg, and other aggregate functions with their corresponding global functions (count_of, sum, avg) across various test files.
- Updated test cases in GroupByStatementTest, HavingClauseTest, SelectColumnsTest, and WhereClausesTest for PostgreSQL, SQLite, and other drivers to reflect the new function usage.
- Ensured consistency in the use of function names and improved readability of the test cases.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 5, 2026

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.

1 participant