Skip to content

add setinputsizes() hook for cx_oracle #4290

Closed
@sqlalchemy-bot

Description

@sqlalchemy-bot
Collaborator

Migrated issue, originally created by Michael Bayer (@zzzeek)

apparently we cannot generalize the setinputsizes() decision for cx_Oracle datatypes.

after many issues reported (by me):

oracle/python-cx_Oracle#68

oracle/python-cx_Oracle#75

oracle/python-cx_Oracle#181

oracle/python-cx_Oracle#189

as of issue 189 above it's clear that there are just some cases where we can't even make an accurate decision, not to mention as cx_Oracle, the Oracle version in use, and settings like charset and numeric settings change, whether or not and how to use setinputsizes with cx_oracle is something that needs constant adjustment.

To suit cases especially like performance-altering behaviors that are touched upon in issues like #4242 as well as oracle/python-cx_Oracle#189, we need to open this up with a new event that intercepts the dialect-level setinputsizes call.

Activity

sqlalchemy-bot

sqlalchemy-bot commented on Jun 28, 2018

@sqlalchemy-bot
CollaboratorAuthor

Michael Bayer (@zzzeek) wrote:

Add do_setinputsizes event for cx_Oracle

Added a new event currently used only by the cx_Oracle dialect,
:meth:.DialectEvents.setiputsizes. The event passes a dictionary of
:class:.BindParameter objects to DBAPI-specific type objects that will be
passed, after conversion to parameter names, to the cx_Oracle
cursor.setinputsizes() method. This allows both visibility into the
setinputsizes process as well as the ability to alter the behavior of what
datatypes are passed to this method.

Change-Id: I43b97c8e3c840cad6f01edb274dc9cfed19cb5fc
Fixes: #4290

c270efd

sqlalchemy-bot

sqlalchemy-bot commented on Jun 28, 2018

@sqlalchemy-bot
CollaboratorAuthor

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
sqlalchemy-bot

sqlalchemy-bot commented on Jun 28, 2018

@sqlalchemy-bot
CollaboratorAuthor

Michael Bayer (@zzzeek) wrote:

Add do_setinputsizes event for cx_Oracle

Added a new event currently used only by the cx_Oracle dialect,
:meth:.DialectEvents.setiputsizes. The event passes a dictionary of
:class:.BindParameter objects to DBAPI-specific type objects that will be
passed, after conversion to parameter names, to the cx_Oracle
cursor.setinputsizes() method. This allows both visibility into the
setinputsizes process as well as the ability to alter the behavior of what
datatypes are passed to this method.

Change-Id: I43b97c8e3c840cad6f01edb274dc9cfed19cb5fc
Fixes: #4290
(cherry picked from commit c270efd)

9cc8bff

added this to the 1.2.x milestone on Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sqlalchemy-bot

        Issue actions

          add setinputsizes() hook for cx_oracle · Issue #4290 · sqlalchemy/sqlalchemy