Fixes in. Hooray.

This commit is contained in:
Yaro Kasear 2025-09-25 10:20:37 -05:00
parent 7a3b11dc32
commit 981d3ea933
5 changed files with 2 additions and 60 deletions

View file

@ -245,7 +245,6 @@ class CRUDService(Generic[T]):
- forward/backward seek via `key` and `backward`
Returns a SeekWindow with items, first/last keys, order spec, limit, and optional total.
"""
self._debug_bind("seek_window")
session = self.session
query, root_alias = self.get_query()
@ -477,7 +476,6 @@ class CRUDService(Generic[T]):
def get(self, id: int, params=None) -> T | None:
"""Fetch a single row by id with conflict-free eager loading and clean projection."""
self._debug_bind("get")
query, root_alias = self.get_query()
# Defaults so we can build a projection even if params is None
@ -572,7 +570,6 @@ class CRUDService(Generic[T]):
def list(self, params=None) -> list[T]:
"""Offset/limit listing with smart relationship loading and clean projection."""
self._debug_bind("list")
query, root_alias = self.get_query()
# Defaults so we can reference them later even if params is None

View file

@ -26,32 +26,6 @@ def init_app(app: Flask, *, runtime: CRUDKitRuntime | None = None, config: type[
try:
bound_engine = getattr(SessionFactory, "bind", None) or getattr(SessionFactory, "kw", {}).get("bind") or engine
pool = bound_engine.pool
from sqlalchemy import event
@event.listens_for(pool, "checkout")
def _on_checkout(dbapi_conn, conn_record, conn_proxy):
sz = pool.size()
chk = pool.checkedout()
try:
conns_in_pool = pool.checkedin()
except Exception:
conns_in_pool = "?"
print(f"POOL CHECKOUT: Pool size: {sz} Connections in pool: {conns_in_pool} "
f"Current Overflow: {pool.overflow()} Current Checked out connections: {chk} "
f"engine id= {id(bound_engine)}")
@event.listens_for(pool, "checkin")
def _on_checkin(dbapi_conn, conn_record):
sz = pool.size()
chk = pool.checkedout()
try:
conns_in_pool = pool.checkedin()
except Exception:
conns_in_pool = "?"
print(f"POOL CHECKIN: Pool size: {sz} Connections in pool: {conns_in_pool} "
f"Current Overflow: {pool.overflow()} Current Checked out connections: {chk} "
f"engine id= {id(bound_engine)}")
except Exception as e:
print(f"[crudkit.init_app] Failed to attach pool listeners: {e}")