asyncpg
asyncpg copied to clipboard
Add support for `WHERE` clause in `copy_to` methods
Hi there,
This PR closes issue #939, and adds support for a where parameter in the copy_to family of methods. It is not a breaking change and will not affect existing code. Apologies for the delay - work has been pretty crazy the past couple days.
There are a couple things I'm unsure of here and wanted to flag:
- Is the addition of
UnsupportedServerFeatureErrorwarranted? The existing exception types didn't seem like a good fit, but maybe this is too much of a special case to warrant its own. - Is raising an exception the desired behavior on unsupported Postgres versions? I don't really see a reasonable way to "backport" this behavior in order to avoid an exception, but maybe I'm missing something.
- There is the option of issuing a warning instead, and allowing the inevitable syntax error to bubble up. But that feels a bit convoluted to me and isn't something I like.
If anything here looks off, please let me know. Thanks!
Whoops, just realized that I didn't request a review. @elprans, any chance you'd be able to take a look? I think I'm unable to use the usual GitHub flow for it since this is my first PR?