]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Support stream_results in the pg8000 dialect
authorTony Locke <tlocke@tlocke.org.uk>
Thu, 29 Apr 2021 18:25:09 +0000 (14:25 -0400)
committersqla-tester <sqla-tester@sqlalchemy.org>
Thu, 29 Apr 2021 18:25:09 +0000 (14:25 -0400)
commit95523c78dd2e2aeb2603734d20383c6d3dac5dfb
treef6e95ccf8632fb8b1740cbff242dc1c9d7c25c34
parent28493bf4bc35a4802b57b02a8b389cec7b6dcbb6
Support stream_results in the pg8000 dialect

### Description
This change adds support for stream_results for the pg8000 dialect by adding a server side cursor. The server-side cursor is a wrapper around a standard DBAPI cursor, and uses the SQL-level cursors. This is being discussed in issue https://github.com/sqlalchemy/sqlalchemy/issues/6198 and this pull request is really to give a concrete example of what I was suggesting.

### Checklist

<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [x] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #6356
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6356
Pull-request-sha: 071e118a6b09a26c511b39b0d589ebd2de8d508c

Change-Id: Id1a865adf0ff64294c71814681f5b4d593939db6
doc/build/changelog/unreleased_14/pg8000_sscursor.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/pg8000.py
lib/sqlalchemy/testing/suite/test_results.py