]> git.ipfire.org Git - thirdparty/psycopg.git/commit
Move 'make_row' attribute from Transformer to Cursor
authorDenis Laxalde <denis.laxalde@dalibo.com>
Wed, 14 Apr 2021 14:02:53 +0000 (16:02 +0200)
committerDenis Laxalde <denis.laxalde@dalibo.com>
Fri, 23 Apr 2021 06:50:16 +0000 (08:50 +0200)
commite8b8fdc848c615baa90fbb250c75fec486af58b4
tree19e9f5a24c747629a95023a69d0d96be4c822ec2
parentc0178fc1fb08a4d46995538ab906ca9f9e0b040f
Move 'make_row' attribute from Transformer to Cursor

Having this attribute defined in Transformer protocol will be
problematic when making the RowMaker protocol generic on Row because
we'll then have to also make Transformer generic on Row and
"propagating" the type variable will produce a lot of churn in the code
base.

Also, the variance (covariant) of Row in RowMaker will conflict with that
in Transformer (invariant).

On the other hand, keeping the RowMaker value and its underlying
RowFactory together/attached to the same object (now Cursor) seems
safer for consistency.
psycopg3/psycopg3/_transform.py
psycopg3/psycopg3/cursor.py
psycopg3/psycopg3/proto.py
psycopg3/psycopg3/server_cursor.py
psycopg3_c/psycopg3_c/_psycopg3.pyi
psycopg3_c/psycopg3_c/_psycopg3/transform.pyx
tests/test_rows.py