Skip to content

Commit

Permalink
S01E06
Browse files Browse the repository at this point in the history
  • Loading branch information
ansipunk committed Mar 3, 2024
1 parent ddd8aaa commit e08eb4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions databases/backends/common/records.py
@@ -1,4 +1,5 @@
import typing
from collections import namedtuple

from sqlalchemy.engine.interfaces import Dialect
from sqlalchemy.engine.row import Row as SQLRow
Expand Down Expand Up @@ -39,6 +40,9 @@ def __init__(

@property
def _mapping(self) -> typing.Mapping:
if hasattr(self._row, "_asdict"):
return self._row._asdict()

return self._row

def keys(self) -> typing.KeysView:
Expand Down
5 changes: 4 additions & 1 deletion databases/backends/psycopg.py
Expand Up @@ -168,7 +168,10 @@ def raw_connection(self) -> typing.Any:
def _compile(
self, query: ClauseElement,
) -> typing.Tuple[str, typing.Mapping[str, typing.Any], tuple]:
compiled = query.compile(dialect=self._dialect)
compiled = query.compile(
dialect=self._dialect,
compile_kwargs={"render_postcompile": True},
)

compiled_query = compiled.string
params = compiled.params
Expand Down

0 comments on commit e08eb4f

Please sign in to comment.