Skip to content

Commit 25205d9

Browse files
committed
a bit shitty
1 parent f84e216 commit 25205d9

File tree

1 file changed

+11
-5
lines changed
  • packages/postgres-database/src/simcore_postgres_database

1 file changed

+11
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
from collections.abc import Awaitable
99
from typing import Any, Protocol, TypeAlias, TypeVar
1010

11-
from sqlalchemy.sql.dml import Delete, Insert, Update
12-
from sqlalchemy.sql.elements import TextClause
13-
from sqlalchemy.sql.selectable import Select
11+
from sqlalchemy.sql import Executable
1412

1513
# Type for query results
1614
Result = TypeVar("Result")
@@ -35,9 +33,17 @@ class DBConnection(Protocol):
3533
"""Protocol to account for both aiopg and SQLAlchemy async connections"""
3634

3735
async def scalar(
38-
self, statement: Select | Insert | Update | Delete | TextClause, **kwargs
36+
self,
37+
statement: Executable,
38+
parameters: dict[str, Any] | None = None,
39+
*,
40+
execution_options: dict[str, Any] | None = None,
3941
) -> Any: ...
4042

4143
async def execute(
42-
self, statement: Select | Insert | Update | Delete | TextClause, **kwargs
44+
self,
45+
statement: Executable,
46+
parameters: dict[str, Any] | None = None,
47+
*,
48+
execution_options: dict[str, Any] | None = None,
4349
) -> ResultProxy: ...

0 commit comments

Comments
 (0)