Skip to content

Refactor SQL queries: enforce parameterized bindings and consistent style#49

Merged
solverat merged 2 commits into1.xfrom
fix_sql_statements
Feb 27, 2026
Merged

Refactor SQL queries: enforce parameterized bindings and consistent style#49
solverat merged 2 commits into1.xfrom
fix_sql_statements

Conversation

@solverat
Copy link
Contributor

Audit and cleanup of all raw SQL queries across the codebase (~114 query sites).

  • Replace executeQuery() with executeStatement() for all DML (INSERT/UPDATE/DELETE)
  • Eliminate $db->quote() value embedding in favor of ? / :name parameter bindings
  • Refactor buildConditionPartsFromDescriptor() to return [$conditions, $params] instead of inlining quoted values
  • Replace string concatenation for dynamic table names with sprintf()
  • Apply consistent style: single-quoted PHP strings, SQL keywords uppercase, multi-line formatting for long queries, no trailing semicolons

Deprecations

  • OpenDxp\Db\Helper::fetchPairs => No replacement
  • OpenDxp\Db\Helper::selectAndDeleteWhere => No replacement
  • OpenDxp\Db\Helper::quoteInto => Use parameterized queries with ? or :name placeholders instead.

@solverat solverat self-assigned this Feb 23, 2026
@solverat solverat added the enhancement New feature or request label Feb 23, 2026
… enforce security measures, and clean up redundant code
@solverat solverat marked this pull request as ready for review February 27, 2026 10:05
@solverat solverat removed the request for review from scrummer February 27, 2026 10:06
@solverat solverat merged commit 3b226ff into 1.x Feb 27, 2026
11 checks passed
@solverat solverat deleted the fix_sql_statements branch February 27, 2026 10:28
@solverat solverat added this to the 1.2.3 milestone Feb 27, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants