Files
genai-toolbox/internal/sources/postgres/postgres.go
Mark L 57b77bca09 feat(sources/postgres): add configurable pgx query execution mode (#2477)
Adds optional `queryExecMode` to postgres source config, allowing users
to set pgx `DefaultQueryExecMode` for compatibility with external
connection poolers (e.g. transaction pooling).

Supported values:
- cache_statement (default)
- cache_describe
- describe_exec
- exec
- simple_protocol

Implementation details:
- parse DSN with `pgxpool.ParseConfig`
- map `queryExecMode` to `pgx.QueryExecMode*`
- create pool via `pgxpool.NewWithConfig`
- validate config using `oneof` tag
- document new field in postgres source docs
- add parser/validation tests

Tests run:
`go test -v ./internal/sources/postgres -count=1 -vet=off`

Refs #2385

---------

Co-authored-by: Molt (OpenClaw) <noreply@users.noreply.github.com>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
Co-authored-by: Yuan Teoh <yuanteoh@google.com>
2026-02-18 20:35:44 +00:00

5.8 KiB