[Sqlalchemy-tickets] Issue #4163: cx_oracle requires method to force use of NCHAR and setinputsizes
Brought to you by:
zzzeek
From: Michael B. <iss...@bi...> - 2018-01-15 22:17:15
|
New issue 4163: cx_oracle requires method to force use of NCHAR and setinputsizes for strings https://bitbucket.org/zzzeek/sqlalchemy/issues/4163/cx_oracle-requires-method-to-force-use-of Michael Bayer: thread at: https://groups.google.com/d/msg/sqlalchemy/vsJBLakBP4Y/PVz5zSKCAAAJ Anthony's info for a similar issue at: https://github.com/oracle/python-cx_Oracle/issues/119 potential APIs: e = create_engine("oracle://...", use_nchar_for_unicode=True) or: ``` #!python from sqlalchemy.dialects.oracle import NVARCHAR2 ... Column('data', NVARCHAR2(50, use_nchar=True)) ``` A more open-ended approach, since we occasionally have issues with setinputsizes being needed or not: ``` #!python e = create_engine("oracle://...") e.dialect.setinputsizes(Unicode, cx_Oracle.NCHAR) ``` the third approach could also accommodate for user-defined types. it would need some changes in DefaultDialect.set_input_sizes as well. it's not that easy to let users just override get_dbapi_type() because that is only called upon the "impl" type that is mostly dialect-private. the former is way easier to use but I don't know if people are going to want this applied to all datatypes across the board. |