Skip to content

Replace C-style libpq parameter arrays with std::array in Postgres stores#135

Merged
MisterVVP merged 1 commit into
mainfrom
dev-fix-c-style-arrays-in-codebase
Jul 6, 2026
Merged

Replace C-style libpq parameter arrays with std::array in Postgres stores#135
MisterVVP merged 1 commit into
mainfrom
dev-fix-c-style-arrays-in-codebase

Conversation

@MisterVVP

@MisterVVP MisterVVP commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Fix clang-tidy modernize-avoid-c-arrays errors caused by C-style parameter arrays passed to PQexecParams in the PostgreSQL store implementation.
  • Make parameter handling explicit and safer by using std::array and calling .data() when interoperating with libpq APIs.

Description

  • Added #include <array> to postgres_task_store.cpp and postgres_notification_store.cpp and introduced constexpr parameter counts for affected queries.
  • Replaced const char* ...[], int ...[], and similar C-style arrays with std::array<const char*, N> / std::array<int, N> in task upsert, select-for-update, get, and other query paths in src/server/stores/postgres_task_store.cpp.
  • Applied the same change to push notification store upsert, lookup/existence check, count, list, and delete paths in src/server/stores/postgres_notification_store.cpp, and passed .data() into PQexecParams calls.
  • Kept semantics unchanged (same parameter ordering, lengths/formats, and PQexecParams usage) while eliminating C-style array declarations.

@MisterVVP MisterVVP added the codex Open AI agent contribution label Jul 6, 2026 — with ChatGPT Codex Connector
@MisterVVP MisterVVP self-assigned this Jul 6, 2026
@MisterVVP MisterVVP merged commit 2f1feec into main Jul 6, 2026
13 checks passed
@MisterVVP MisterVVP deleted the dev-fix-c-style-arrays-in-codebase branch July 6, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex Open AI agent contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant