Skip to content

Commit fcc1001

Browse files
committed
cleanup
1 parent 7a97a8a commit fcc1001

File tree

1 file changed

+3
-12
lines changed
  • packages/postgres-database/src/simcore_postgres_database

1 file changed

+3
-12
lines changed

packages/postgres-database/src/simcore_postgres_database/_protocols.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff 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

3934
class 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: ...

0 commit comments

Comments
 (0)