File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
packages/postgres-database/src/simcore_postgres_database Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -23,30 +23,21 @@ class ResultProxy(Protocol):
2323 """Protocol for query result objects from both engines
2424
2525 Handles both aiopg's async methods and SQLAlchemy asyncpg's sync methods.
26- The caller should handle both cases, for example:
27-
28- result = await conn.execute(query)
29- row = await result.fetchone() if hasattr(result.fetchone, '__await__') else result.fetchone()
26+ This is temporary until we fully migrate to asyncpg.
3027 """
3128
3229 def fetchall (self ) -> MaybeCoro [list [Any ]]: ...
3330 def fetchone (self ) -> MaybeCoro [Any | None ]: ...
3431 def first (self ) -> MaybeCoro [Any | None ]: ...
35- def scalar (self ) -> MaybeCoro [Any | None ]: ...
36- def scalar_one_or_none (self ) -> Any | None : ...
3732
3833
3934class DBConnection (Protocol ):
4035 """Protocol to account for both aiopg and SQLAlchemy async connections"""
4136
4237 async def scalar (
4338 self , statement : Select | Insert | Update | Delete | TextClause , ** kwargs
44- ) -> Any :
45- """Execute a statement and return a scalar result"""
46- ...
39+ ) -> Any : ...
4740
4841 async def execute (
4942 self , statement : Select | Insert | Update | Delete | TextClause , ** kwargs
50- ) -> ResultProxy :
51- """Execute a statement and return a result proxy"""
52- ...
43+ ) -> ResultProxy : ...
You can’t perform that action at this time.
0 commit comments