diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-13 10:36:16 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-13 13:06:02 -0400 |
commit | 25b8e89d3d425656e51438b5cac7e6e1f2592817 (patch) | |
tree | 66d2b0c07245f084ad4058c35c502d51332fd192 /lib/sqlalchemy/dialects/postgresql/psycopg2.py | |
parent | a4bfde4a18e50d93e44aec5c6216be8a6f9fbacb (diff) | |
download | sqlalchemy-25b8e89d3d425656e51438b5cac7e6e1f2592817.tar.gz |
Deprecate engine-wise ss cursors; repair mariadbconnector
The server_side_cursors engine-wide feature relies upon
regexp parsing of statements a well as general guessing as
to when the feature should be used. This is not within the
2.0 way of doing things and should be removed.
Additionally, mariadbconnector defaults to unbuffered cursors;
add new cursor hooks so that mariadbconnector can specify
buffered or unbuffered cursors without too much difficulty.
This will also correctly default mariadbconnector to buffered
cursors which should repair the segfaults we've been getting.
Try to restore the assert_raises that was removed in
5b6dfc0c38bf1f01da4b8 to see if mariadbconnector segfaults
are resolved.
Change-Id: I77f1c972c742e40694972f578140bb0cac8c39eb
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/psycopg2.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/psycopg2.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 3cc62fc93..91576c4d2 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -17,18 +17,6 @@ psycopg2 Connect Arguments psycopg2-specific keyword arguments which are accepted by :func:`_sa.create_engine()` are: -* ``server_side_cursors``: Enable the usage of "server side cursors" for SQL - statements which support this feature. What this essentially means from a - psycopg2 point of view is that the cursor is created using a name, e.g. - ``connection.cursor('some name')``, which has the effect that result rows - are not immediately pre-fetched and buffered after statement execution, but - are instead left on the server and only retrieved as needed. SQLAlchemy's - :class:`~sqlalchemy.engine.CursorResult` uses special row-buffering - behavior when this feature is enabled, such that groups of 100 rows at a - time are fetched over the wire to reduce conversational overhead. - Note that the :paramref:`.Connection.execution_options.stream_results` - execution option is a more targeted - way of enabling this mode on a per-execution basis. * ``use_native_unicode``: Enable the usage of Psycopg2 "native unicode" mode per connection. True by default. @@ -129,8 +117,7 @@ in addition to those not specific to DBAPIs: * ``stream_results`` - Enable or disable usage of psycopg2 server side cursors - this feature makes use of "named" cursors in combination with special result handling methods so that result rows are not fully buffered. - If ``None`` or not set, the ``server_side_cursors`` option of the - :class:`_engine.Engine` is used. + Defaults to False, meaning cursors are buffered by default. * ``max_row_buffer`` - when using ``stream_results``, an integer value that specifies the maximum number of rows to buffer at a time. This is @@ -691,7 +678,6 @@ class PGDialect_psycopg2(PGDialect): def __init__( self, - server_side_cursors=False, use_native_unicode=True, client_encoding=None, use_native_hstore=True, @@ -702,7 +688,6 @@ class PGDialect_psycopg2(PGDialect): **kwargs ): PGDialect.__init__(self, **kwargs) - self.server_side_cursors = server_side_cursors self.use_native_unicode = use_native_unicode if not use_native_hstore: self._has_native_hstore = False |