feat(source/postgres): add queryExecMode to managed sources#3378
feat(source/postgres): add queryExecMode to managed sources#3378Swing-G wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces support for configuring the queryExecMode (pgx query execution mode) for AlloyDB and Cloud SQL PostgreSQL sources. It adds the queryExecMode field to the respective configuration structs with validation, updates the connection pool initialization to apply this setting, and adds unit tests to verify parsing of valid and invalid execution modes. Additionally, it extracts the common query execution mode parsing logic into a shared helper function ParsePGXQueryExecMode in internal/sources/pgx.go and refactors the existing Postgres source to use it. No review comments were provided, so there is no feedback to address.
Description
Adds
queryExecModesupport to the AlloyDB for PostgreSQL and Cloud SQL for PostgreSQL sources, using the same pgx query execution mode parser as the PostgreSQL source.This lets managed Postgres sources opt into modes such as
simple_protocolwhen prepared statement caching is not compatible with the connection pooler.PR Checklist
!if this involve a breaking changeTests:
Fixes #2385.