Skip to content

Support SQLProvider without connection pool

Zehao Chen requested to merge zchen723/sql-nullpool into master

Description

This MR adds suppport to create SQLProvier without a connection pool. This can be useful when setting up simple test cases or the connection endpoint is already managed by a 3rd-party connection pool, e.g., pgbouncer.

This behavior is triggered when configuring pool-size == 0. When set, other pool-* parameters are naturally ignored.

Changes proposed in this merge request:

  • Use poolclass=NullPool when pool-size == 0.
  • Update minimum value of pool-size to 0.

Validation

A unit-test for this change is pretty hard. Instead, I added a docker-compose example that connects to pgbouncer.

Merge request reports

Loading