Skip to content

refactor!: simplify client and pool connection model - #19

Merged
myfreess merged 33 commits into
mainfrom
simplify-archtecture
Sep 24, 2026
Merged

myfreess merged 33 commits into
mainfrom
simplify-archtecture

Conversation

@myfreess

Copy link
Copy Markdown
Collaborator

Auto-drive client connections and serialize logical operations. Replace manual pool leases with scoped sessions and direct pool APIs. Internalize prepared statement caching and migrate tests and documentation.

BREAKING CHANGE: client.connect now accepts a TaskGroup and returns Client directly; public Connection and manual pgpool lease/cache APIs are removed.

@myfreess
myfreess force-pushed the simplify-archtecture branch 2 times, most recently from 37892dd to 84049ab Compare August 10, 2026 09:42
@myfreess
myfreess force-pushed the simplify-archtecture branch 2 times, most recently from 82d1821 to 13b5f05 Compare September 17, 2026 09:04
Auto-drive client connections and serialize logical operations. Replace manual pool leases with scoped sessions and direct pool APIs. Internalize prepared statement caching and migrate tests.

BREAKING CHANGE: client.connect now accepts a TaskGroup and returns Client directly; public Connection and manual pgpool lease/cache APIs are removed.
@myfreess
myfreess force-pushed the simplify-archtecture branch from 13b5f05 to 1dcef19 Compare September 18, 2026 02:13
Document auto-driven client sessions, serialized logical operations, direct pool APIs, and callback-scoped session affinity.
Pool operation and callback shields can finish successfully while task
cancellation is pending. Check cancellation before new work and after leaving
protection, including transaction and savepoint auto-commit boundaries. Keep
protocol cleanup and rollback protected, and complete already-sent COMMITs
according to their server results.

Add operation/session boundary tests and PostgreSQL lock-wait regressions for
transactions and nested savepoints. Document the cancellation guarantees.
@myfreess
myfreess force-pushed the simplify-archtecture branch from 1dcef19 to 6cbe2f5 Compare September 18, 2026 08:54
Construct the client without network I/O, run its socket driver through a single-use executor, and expose repeatable readiness and completion results. Move detached drains under executor ownership and cover startup, shutdown, and cancellation paths.

Keep connect(config, group) as a transition adapter until the pool and integration callers move to the new lifecycle in the following commit.
Construct pools without starting physical connections. Run creation, retirement, and shutdown inside a single-use pool executor that owns the client executors, and migrate integration callers to the explicit lifecycle.

Remove the transitional client.connect adapter and bump the package version to 0.1.0. Update pool documentation and coverage for readiness, close, and driver failure.

BREAKING CHANGE: Pool::new returns a pool and executor pair; Connector now returns a client and executor pair, and client.connect is removed.
@myfreess
myfreess force-pushed the simplify-archtecture branch from 33ffbf5 to 12e62b3 Compare September 18, 2026 10:17
@myfreess
myfreess force-pushed the simplify-archtecture branch 5 times, most recently from 8bed53c to ce74850 Compare September 21, 2026 03:07
@myfreess
myfreess force-pushed the simplify-archtecture branch from ce74850 to a92b601 Compare September 21, 2026 03:14
@myfreess
myfreess force-pushed the simplify-archtecture branch from 16a29e2 to 5b06007 Compare September 21, 2026 03:44
@myfreess
myfreess force-pushed the simplify-archtecture branch from 99a39e6 to d1d9787 Compare September 23, 2026 03:49
@myfreess
myfreess merged commit d0d7145 into main Sep 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant