summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/oracle
Commit message (Collapse)AuthorAgeFilesLines
* Ensure (+) is rendered for all right-hand membersticket_4076Mike Bayer2017-09-131-5/+10
| | | | | | | | | | Fixed bug where Oracle 8 "non ansi" join mode would not add the ``(+)`` operator to expressions that used an operator other than the ``=`` operator. The ``(+)`` needs to be on all columns that are part of the right-hand side. Change-Id: I952e2369f11b78f5b918456ae3a5b0768d9761ec Fixes: #4076
* Refactor for cx_Oracle version 6oracle_numericMike Bayer2017-09-113-537/+399
| | | | | | | | | Drops support for cx_Oracle prior to version 5.x, reworks numeric and binary support. Fixes: #4064 Change-Id: Ib9ae9aba430c15cd2a6eeb4e5e3fd8e97b5fe480
* First level repair for cx_Oracle 6.0 test regressionsMike Bayer2017-08-181-1/+3
| | | | | | | | | | | | Fixed more regressions caused by cx_Oracle 6.0; at the moment, the only behavioral change for users is disconnect detection now detects for cx_Oracle.DatabaseError in addition to cx_Oracle.InterfaceError, as this behavior seems to have changed. Other issues regarding numeric precision and uncloseable connections are pending with the upstream cx_Oracle issue tracker. Change-Id: Id61f1e33b21c155a598396340dfdecd28ff4066b Fixes: #4045
* Ensure Oracle index w/ col DESC etc. is reflectedMike Bayer2017-08-141-13/+11
| | | | | | | | | | | | | | | | | | | | Fixed bug where an index reflected under Oracle with an expression like "column DESC" would not be returned, if the table also had no primary key, as a result of logic that attempts to filter out the index implicitly added by Oracle onto the primary key columns. Reworked the "filter out the primary key index" logic in oracle get_indexes() to be clearer. This changeset also adds an internal check to ColumnCollection to accomodate for the case of a column being added twice, as well as adding a private _table argument to Index such that reflection can specify the Table explicitly. The _table argument can become part of public API in a later revision or release if needed. Change-Id: I745711e03b3e450b7f31185fc70e10d3823063fa Fixes: #4042
* Revert cx_Oracle WITH_UNICODE change under > 5.0Mike Bayer2017-07-281-4/+13
| | | | | | | | | | | | | | | | Fixed performance regression caused by the fix for :ticket:`3937` where cx_Oracle as of version 5.3 dropped the ``.UNICODE`` symbol from its namespace, which was interpreted as cx_Oracle's "WITH_UNICODE" mode being turned on unconditionally, which invokes functions on the SQLAlchemy side which convert all strings to unicode unconditionally and causing a performance impact. In fact, per cx_Oracle's author the "WITH_UNICODE" mode has been removed entirely as of 5.1, so the expensive unicode conversion functions are no longer necessary and are disabled if cx_Oracle 5.1 or greater is detected under Python 2. The warning against "WITH_UNICODE" mode that was removed under :ticket:`3937` is also restored. Change-Id: Iddd38d81a5adb27c953a5ee2eae5529a21da16e1 Fixes: #4035
* Implement get_unique_constraints, get_check_constraints for OracleEloy Felix2017-05-301-2/+109
| | | | | | | | Pull-request: https://github.com/zzzeek/sqlalchemy/pull/326 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/342 Fixes: #4002 Change-Id: I221fe8ba305fc455a03e3a5d15f803bf8ee2e8fb
* Remove twophase for cx_Oracle 6.xMike Bayer2017-05-231-35/+21
| | | | | | | | | | | Support for two-phase transactions has been removed entirely for cx_Oracle when version 6.0b1 or later of the DBAPI is in use. The two- phase feature historically has never been usable under cx_Oracle 5.x in any case, and cx_Oracle 6.x has removed the connection-level "twophase" flag upon which this feature relied. Change-Id: I2e8161cc2bc12f4845c9224cd483038112fe9734 Fixes: #3997
* Use regexp to parse cx_oracle version stringMike Bayer2017-05-091-2/+12
| | | | | | | | | Fixed bug in cx_Oracle dialect where version string parsing would fail for cx_Oracle version 6.0b1 due to the "b" character. Version string parsing is now via a regexp rather than a simple split. Change-Id: I2af7172b0d7184e3ea3bd051e9fa8d6ca2a571cd Fixes: #3975
* Use config.db global opts as defaults for all testing_engine()Mike Bayer2017-03-221-0/+2
| | | | | | | | | | Some options need to be passed to engines in all cases, such as currently the oracle 12516 workaround. make sure calls to testing_engine also set up the dictionary with defaults even if options is passed. not clear if this affects other backends yet. Change-Id: I5a1f7634e4ce5af6fe55dc21a24db6afacd19bb7
* New features from python 2.7Катаев Денис2017-03-171-4/+4
| | | | | | | After bump minimum supported version to 2.7 (1da9d3752160430c91534a8868ceb8c5ad1451d4), we can use new syntax. Change-Id: Ib064c75a00562e641d132f9c57e5e69744200e05 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/347
* Implement comments for tables, columnsFrazer McLean2017-03-171-9/+43
| | | | | | | | | | | | | | Added support for SQL comments on :class:`.Table` and :class:`.Column` objects, via the new :paramref:`.Table.comment` and :paramref:`.Column.comment` arguments. The comments are included as part of DDL on table creation, either inline or via an appropriate ALTER statement, and are also reflected back within table reflection, as well as via the :class:`.Inspector`. Supported backends currently include MySQL, Postgresql, and Oracle. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Fixes: #1546 Change-Id: Ib90683850805a2b4ee198e420dc294f32f15d35d
* Enable sane_multi_rowcount for cx_OracleMike Bayer2017-03-142-2/+5
| | | | | | | Also add some tests to test_rowcount. Change-Id: Idaa18fdc4fcfeb615725531c37de77decf76a783 Fixes: #3932
* Normalize Oracle reflected FK constraint nameMike Bayer2017-03-131-0/+2
| | | | | | | | | | | | | Oracle reflection now "normalizes" the name given to a foreign key constraint, that is, returns it as all lower case for a case insensitive name. This was already the behavior for indexes and primary key constraints as well as all table and column names. This will allow Alembic autogenerate scripts to compare and render foreign key constraint names correctly when initially specified as case insensitive. Change-Id: Ibb34ec6ce7cb244d1c4ae9d44ce2d37d37227e69 Fixes: #3276
* Repair _execute_scalar for WITH_UNICODE modeMike Bayer2017-03-131-15/+24
| | | | | | | | | | | | | | | | | cx_Oracle 5.3 seems to code this flag ON now, so remove the warning and ensure WITH_UNICODE handling works. Additionally, the XE setup on jenkins is having more problems here, in particular low-connections mode is causing cx_Oracle to fail more frequently now. Turning off low-connections fixes those but then we get the TNS errors, so adding an emergency "retry" flag that is not yet a feature available to users. Real world applications are not dropping/creating thousands of tables the way our test suite is. Change-Id: Ie95b0e697276c404d3264c2e624e870463d966d6 Fixes: #3937
* - update asktom link, fixes #3925Mike Bayer2017-03-061-1/+1
| | | | Change-Id: Ibd63311dfccebbdf67e8ad7dc56ad311bf573895
* update for 2017 copyrightMike Bayer2017-01-044-4/+4
| | | | Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
* Bump "table compression" flag to Oracle 10.1Mike Bayer2016-12-201-1/+1
| | | | | | | | | | - Fixed bug where the "COMPRESSION" keyword was used in the ALL_TABLES query on Oracle 9.2; even though Oracle docs state table compression was introduced in 9i, the actual column is not present until 10.1. Change-Id: Iebfa59bfcfdff859169df349a5426137ab006e67 Fixes: #3875
* Add exclude_tablespaces argument to OracleDavid Fraser2016-09-201-12/+47
| | | | | | | | | Allows the SYSTEM and SYSAUX tablespaces to be only conditionally omitted when doing get_table_names() and get_temp_table_names(). Change-Id: Ie6995873f05163f2ce473a6a9c2d958a30681b44 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/292
* Spelling fixespr/299Ville Skyttä2016-08-081-1/+1
|
* Adapt "FOR UPDATE OF" with Oracle limit/offsetMike Bayer2016-07-051-3/+22
| | | | | | | | | | This modifies the Oracle ROWNUM limit/offset approach to accommodate for the "OF" clause in a "FOR UPDATE" phrase. The column expressions must be added to the selected subquery if necessary and adapted on the outside. Change-Id: Ia71b5fc4df6d326e73863f8ae9f96e8f1a5acfc1 Fixes: #3741
* Replace some uses of re.sub with str.lstrip/replaceVille Skyttä2016-06-061-1/+1
| | | | | Change-Id: I98cd60b6830ee94e39ba9307523a9e8fb93bf4e8 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/280
* Add SKIP LOCKED support for Postgresql, OracleJack Zhou2016-06-021-0/+2
| | | | | | | | This adds `SELECT ... FOR UPDATE SKIP LOCKED`/ `SELECT ... FOR SHARE SKIP LOCKED` rendering. Change-Id: Id1dc4f1cafc1de23f397a6f73d54ab2c58d5910d Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/86
* Fix TypeError during cx_Oracle connectionJohn Vandenberg2016-05-161-3/+7
| | | | | | | | | | | cx_Oracle connection parameters user, password and dsn must be either a string or NULL. When they are passed a Python None object, "TypeError: expecting string, unicode or buffer object" is raised. Fixes: #3705 Change-Id: I8da5d8a227ca12c9bf17a6127460e413841951fb Pull-request: https://github.com/zzzeek/sqlalchemy/pull/271
* - py3k fix for enum featureMike Bayer2016-02-081-1/+4
|
* - add an impl for Enum to Oracle which has subclassing requirementsMike Bayer2016-02-041-0/+13
| | | | | | | on unicode. Enum would be better as a TypeDecorator at this point but then that becomes awkward with native enum types (Interval works that way, but we don't need the bind_processor for native interval...)
* Merge branch 'master' of https://bitbucket.org/carlrivers/sqlalchemyMike Bayer2016-02-021-2/+1
|\
| * Merged zzzeek/sqlalchemy into masterCarlos Rivas2016-01-261-2/+1
| |\
| * | Removed entry that causes AttributeError (#3621) - Oracle zxJDBC fails with ↵Carlos Rivas2016-01-231-2/+1
| | | | | | | | | | | | AttributeError in object OracleCompiler_zxjdbc
* | | - happy new yearMike Bayer2016-01-294-4/+4
| |/ |/|
* | - update oracle JDBC driver URL, fixes #3554Mike Bayer2016-01-201-2/+1
|/
* - for DB's w/o a real "autoincrement", reflection should be returningMike Bayer2015-10-071-1/+1
| | | | "auto", doesn't matter if there's a default here
* - Fixed bug in Oracle dialect where reflection of tables and otherMike Bayer2015-10-051-0/+3
| | | | | | | | symbols with names quoted to force all-lower-case would not be identified properly in reflection queries. The :class:`.quoted_name` construct is now applied to incoming symbol names that detect as forced into all-lower-case within the "name normalize" process. fixes #3548
* - Fixed support for cx_Oracle version 5.2, which was trippingMike Bayer2015-07-291-2/+5
| | | | | | | | up SQLAlchemy's version detection under Python 3 and inadvertently not using the correct unicode mode for Python 3. This would cause issues such as bound variables mis-interpreted as NULL and rows silently not being returned. fixes #3491
* - also add this to Oracle, and defensively to firebird and sybaseMike Bayer2015-03-241-0/+2
|
* - add a note that we aren't really doing zxjdbc right now even thoughMike Bayer2015-03-201-0/+3
| | | | these files are present.
* - copyright 2015Mike Bayer2015-03-104-4/+4
|
* - rename _select_wrapsMike Bayer2015-03-081-2/+1
| | | | | - replace force_result_map with a mini-API for nested result sets, add coverage
* - the change for #918 was of course not nearly that simple.Mike Bayer2015-03-071-3/+3
| | | | | | | | | | | | | | | | | | The "wrapping" employed by the mssql and oracle dialects using the "iswrapper" argument was not being used intelligently by the compiler, and the result map was being written incorrectly, using *more* columns in the result map than were actually returned by the statement, due to "row number" columns that are inside the subquery. The compiler now writes out result map on the "top level" select in all cases fully, and for the mssql/oracle wrapping case extracts out the "proxied" columns in a second step, which only includes those columns that are proxied outwards to the top level. This change might have implications for 3rd party dialects that might be imitating oracle's approach. They can safely continue to use the "iswrapper" kw which is now ignored, but they may need to also add the _select_wraps argument as well.
* - The SQL compiler now generates the mapping of expected columnspositional_targetingMike Bayer2015-03-071-2/+3
| | | | | | | | | | | | | | | | | such that they are matched to the received result set positionally, rather than by name. Originally, this was seen as a way to handle cases where we had columns returned with difficult-to-predict names, though in modern use that issue has been overcome by anonymous labeling. In this version, the approach basically reduces function call count per-result by a few dozen calls, or more for larger sets of result columns. The approach still degrades into a modern version of the old approach if textual elements modify the result map, or if any discrepancy in size exists between the compiled set of columns versus what was received, so there's no issue for partially or fully textual compilation scenarios where these lists might not line up. fixes #918 - callcounts still need to be adjusted down for this so zoomark tests won't pass at the moment
* - add versionadded for service_nameMike Bayer2015-02-081-0/+2
|
* - cx_Oracle.makedsn can now be passed service_name; squashSławek Ehlert2014-04-021-2/+20
| | | | commit of pr152
* - Custom dialects that implement :class:`.GenericTypeCompiler` canMike Bayer2015-01-161-31/+31
| | | | | | | | | | | | | | now be constructed such that the visit methods receive an indication of the owning expression object, if any. Any visit method that accepts keyword arguments (e.g. ``**kw``) will in most cases receive a keyword argument ``type_expression``, referring to the expression object that the type is contained within. For columns in DDL, the dialect's compiler class may need to alter its ``get_column_specification()`` method to support this as well. The ``UserDefinedType.get_col_spec()`` method will also receive ``type_expression`` if it provides ``**kw`` in its argument signature. fixes #3074
* - New Oracle DDL features for tables, indexes: COMPRESS, BITMAP.Mike Bayer2014-12-041-9/+156
| | | | | Patch courtesy Gabor Gombas. fixes #3127
* - Added support for CTEs under Oracle. This includes some tweaksMike Bayer2014-12-041-15/+6
| | | | | | | to the aliasing syntax, as well as a new CTE feature :meth:`.CTE.suffix_with`, which is useful for adding in special Oracle-specific directives to the CTE. fixes #3220
* - Fixed long-standing bug in Oracle dialect where bound parameterMike Bayer2014-10-111-1/+2
| | | | | | names that started with numbers would not be quoted, as Oracle doesn't like numerics in bound parameter names. fixes #2138
* - Added support for the Oracle table option ON COMMIT. This is beingMike Bayer2014-09-171-2/+44
| | | | | | | | | kept separate from Postgresql's ON COMMIT for now even though ON COMMIT is in the SQL standard; the option is still very specific to temp tables and we eventually would provide a more first class temporary table feature. - oracle can apparently do get_temp_table_names() too, so implement that, fix its get_table_names(), and add it to #3204. fixes #3204 again.
* - ensure literal_binds works with LIMIT clause, FOR UPDATEMike Bayer2014-09-031-3/+3
|
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-204-342/+436
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-094-4/+8
| | | | to get all flake8 passing
* - repair oracle compilation for new limit/offset system.Mike Bayer2014-05-241-15/+26
|