Explain PR #529: PgBouncer support + split CI workflows #222

Closed
opened 2026-02-16 00:20:33 -05:00 by yindo · 0 comments
Owner

Originally created by @Yeuoly on GitHub (Dec 17, 2025).

Background

This repository currently supports connecting directly to PostgreSQL/MySQL, but some deployments sit behind PgBouncer (often in transaction pooling mode). In that setup, some client behaviors (notably prepared statements) can cause issues.

At the same time, CI previously mixed multiple test types in one workflow, and database coverage was limited.

What this PR does

PR: https://github.com/langgenius/dify-plugin-daemon/pull/529

  • PgBouncer support

    • Adds pgbouncer as a first-class DB type (DB_TYPE_PG_BOUNCER).
    • Uses a unified PG init path, but disables GORM prepared statements for PgBouncer to better match transaction pooling behavior.
  • DB init / connection refactor

    • Consolidates GORM configuration and DSN building for PostgreSQL-related connections.
  • Database integration tests (multi-driver)

    • Adds integration tests that exercise CRUD + transaction helpers across:
      • PostgreSQL
      • PgBouncer (port 6432)
      • MySQL
  • CI workflow restructuring

    • Replaces the old combined workflow with separated workflows for:
      • unit tests
      • DB integration tests
      • plugin integration tests
    • Centralizes test dependencies into integration/docker/docker-compose.ci.yml and starts them via hoverkraft-tech/compose-action.

How to verify

Locally:

  1. docker compose -f integration/docker/docker-compose.ci.yml up -d
  2. go test -v ./integration/db/...
  3. go test -v ./integration/plugin/...

Notes / review focus

  • PgBouncer behavior differences (especially prepared statements) are the key motivation.
  • CI now depends on Docker Compose-based services; reviewers may want to sanity-check the compose config and ports.
Originally created by @Yeuoly on GitHub (Dec 17, 2025). ## Background This repository currently supports connecting directly to PostgreSQL/MySQL, but some deployments sit behind **PgBouncer** (often in *transaction pooling* mode). In that setup, some client behaviors (notably prepared statements) can cause issues. At the same time, CI previously mixed multiple test types in one workflow, and database coverage was limited. ## What this PR does PR: https://github.com/langgenius/dify-plugin-daemon/pull/529 - **PgBouncer support** - Adds `pgbouncer` as a first-class DB type (`DB_TYPE_PG_BOUNCER`). - Uses a unified PG init path, but **disables GORM prepared statements for PgBouncer** to better match transaction pooling behavior. - **DB init / connection refactor** - Consolidates GORM configuration and DSN building for PostgreSQL-related connections. - **Database integration tests (multi-driver)** - Adds integration tests that exercise CRUD + transaction helpers across: - PostgreSQL - PgBouncer (port `6432`) - MySQL - **CI workflow restructuring** - Replaces the old combined workflow with separated workflows for: - unit tests - DB integration tests - plugin integration tests - Centralizes test dependencies into `integration/docker/docker-compose.ci.yml` and starts them via `hoverkraft-tech/compose-action`. ## How to verify Locally: 1. `docker compose -f integration/docker/docker-compose.ci.yml up -d` 2. `go test -v ./integration/db/...` 3. `go test -v ./integration/plugin/...` ## Notes / review focus - PgBouncer behavior differences (especially prepared statements) are the key motivation. - CI now depends on Docker Compose-based services; reviewers may want to sanity-check the compose config and ports.
yindo added the enhancementgo labels 2026-02-16 00:20:33 -05:00
yindo closed this issue 2026-02-16 00:20:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#222