]> git.ipfire.org Git - thirdparty/psycopg.git/commit
refactor(copy): add Writer object
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 11 Jun 2022 14:21:38 +0000 (16:21 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 19 Jul 2022 14:09:52 +0000 (15:09 +0100)
commit31ae2dc123b863787f3cf174888fa30478069708
tree5a852a0312d8f50781879957b7b03cf0b79770a9
parent14737ff19324f32baa30d9fc38edbb3ae1fa37a6
refactor(copy): add Writer object

This separation of responsibility will allow to:

- create writers that e.g. produce a file rather than writing to a
connection;

- create writers that write directly instead of using a queue (see
https://github.com/psycopg/psycopg/discussions/111 for an example of users
unhappy about that. I still don't see their nervousness justified, but
I'm ok to provide them an escape hatch if it's easy to implement).
psycopg/psycopg/copy.py
tests/test_copy.py