Commit Graph

109 Commits

Author SHA1 Message Date
Mike Bayer 4578ab54a5 - Fixed bug in Oracle dialect where reflection of tables and other
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
2015-10-05 09:49:34 -04:00
Mike Bayer 7c9a0e18be - fix some more result_map calls 2015-03-08 14:16:59 -04:00
Mike Bayer 17b2fd3fba - the change for #918 was of course not nearly that simple.
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.
2015-03-07 23:03:27 -05:00
Sławek Ehlert 3db84b174a - cx_Oracle.makedsn can now be passed service_name; squash
commit of pr152
2014-04-02 13:45:53 -04:00
Mike Bayer edef953797 - New Oracle DDL features for tables, indexes: COMPRESS, BITMAP.
Patch courtesy Gabor Gombas.
fixes #3127
2014-12-04 20:08:07 -05:00
Mike Bayer e46c71b419 - Added support for CTEs under Oracle. This includes some tweaks
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
2014-12-04 19:35:00 -05:00
Mike Bayer cc29c4afff - Fixed long-standing bug in Oracle dialect where bound parameter
names that started with numbers would not be quoted, as Oracle
doesn't like numerics in bound parameter names.
fixes #2138
2014-10-11 18:25:21 -04:00
Mike Bayer e3f07f7206 - Added support for the Oracle table option ON COMMIT. This is being
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.
2014-09-17 19:43:45 -04:00
Mike Bayer 7c6a45c480 - The :func:~.expression.column and :func:~.expression.table
constructs are now importable from the "from sqlalchemy" namespace,
just like every other Core construct.
- The implicit conversion of strings to :func:`.text` constructs
when passed to most builder methods of :func:`.select` as
well as :class:`.Query` now emits a warning with just the
plain string sent.   The textual conversion still proceeds normally,
however.  The only method that accepts a string without a warning
are the "label reference" methods like order_by(), group_by();
these functions will now at compile time attempt to resolve a single
string argument to a column or label expression present in the
selectable; if none is located, the expression still renders, but
you get the warning again. The rationale here is that the implicit
conversion from string to text is more unexpected than not these days,
and it is better that the user send more direction to the Core / ORM
when passing a raw string as to what direction should be taken.
Core/ORM tutorials have been updated to go more in depth as to how text
is handled.
fixes #2992
2014-09-01 20:19:54 -04:00
Mike Bayer d2358629c9 - scale up for mysql, sqlite 2014-07-26 20:50:57 -04:00
Mike Bayer 0eb53b2e79 - Fixed bug in oracle dialect test suite where in one test,
'username' was assumed to be in the database URL, even though
this might not be the case.  Fixes #3128
2014-07-18 14:27:59 -04:00
Mike Bayer 8a4f75e972 - repair oracle compilation for new limit/offset system. 2014-05-24 21:45:15 -04:00
Mike Bayer be3c185fd4 - Added new datatype :class:.oracle.DATE, which is a subclass of
:class:`.DateTime`.  As Oracle has no "datetime" type per se,
it instead has only ``DATE``, it is appropriate here that the
``DATE`` type as present in the Oracle dialect be an instance of
:class:`.DateTime`.  This issue doesn't change anything as far as
the behavior of the type, as data conversion is handled by the
DBAPI in any case, however the improved subclass layout will help
the use cases of inspecting types for cross-database compatibility.
Also removed uppercase ``DATETIME`` from the Oracle dialect as this
type isn't functional in that context.  fixes #2987
2014-03-22 18:22:17 -04:00
Mike Bayer a4e84a154c - cx_oracle test for "unicode returns" needs to be cx_oracle only,
and also will fail on py3k.
- enhance exclusions so that a requirement attribute can be passed
to fails_if/skip_if.
- fix coverage docs to mention pytest.
2014-03-06 11:57:54 -05:00
Christoph Zwerschke c4dede6e7c Restore coercion to unicode with cx_Oracle.
This feature is now turned off by default.
2014-02-27 21:15:21 +01:00
Mike Bayer 31cecebd48 - add support for specifying tables or entities for "of"
- implement Query with_for_update()
- rework docs and tests
2013-11-28 23:23:27 -05:00
Mike Bayer 4aaf3753d7 - fix up rendering of "of"
- move out tests, dialect specific out of compiler, compiler tests use new API,
legacy API tests in test_selecatble
- add support for adaptation of ForUpdateArg, alias support in compilers
2013-11-28 22:25:09 -05:00
Mike Bayer 467784e89c Fixed bug where Oracle `VARCHAR` types given with no length
(e.g. for a ``CAST`` or similar) would incorrectly render ``None CHAR``
or similar. [ticket:2870]
2013-11-22 17:56:35 -05:00
Mike Bayer 6661cba88d - cleanup 2013-11-22 17:48:55 -05:00
Mike Bayer 5070c81ab9 - Fixed bug where Oracle table reflection using synonyms would fail
if the synonym and the table were in different remote schemas.
Patch to fix courtesy Kyle Derr. [ticket:2853]
2013-10-25 19:11:53 -04:00
Mike Bayer 9bc9d5c106 - Fixed bug in default compiler plus those of postgresql, mysql, and
mssql to ensure that any literal SQL expression values are
rendered directly as literals, instead of as bound parameters,
within a CREATE INDEX statement. [ticket:2742]
- don't need expression_as_ddl(); literal_binds and include_table
take care of this functionality.
2013-10-12 20:04:55 -04:00
Mike Bayer 0e83f757a8 can remove this, issue is fixed 2013-06-17 16:05:11 -04:00
Mike Bayer 07e6161c6b - clean up this test (really we don't even need this, it's not testing much)
- for the moment, put a catch in it to see if we can trap that issue
on jenkins
2013-06-16 23:09:31 -04:00
Mike Bayer 85368d25ed get nested joins to render on oracle 8 2013-06-08 18:54:14 -04:00
Mike Bayer 38f65baf18 - oracle tests passing in py3k!! 2013-05-26 17:58:07 -04:00
Mike Bayer abc4331293 a few more oracle fixes 2013-05-26 17:39:53 -04:00
Mike Bayer 46b0b14fde cleanup for oracle 2013-05-26 17:37:03 -04:00
Mike Bayer 2e75f668f3 merge default 2013-05-15 15:47:11 -04:00
Mike Bayer cfb0f9ca14 Regression from this ticket caused the unsupported keyword
"true" to render, added logic to convert this to 1/0
for SQL server.
[ticket:2682]
2013-05-15 15:46:29 -04:00
Mike Bayer 4b614b9b35 - the raw 2to3 run
- went through examples/ and cleaned out excess list() calls
2013-04-27 19:53:57 -04:00
Mike Bayer c8a80e2130 - remove all compat items that are pre-2.5 (hooray)
- other cleanup
- don't need compat.decimal, that approach never panned out. hopefully
outside libs aren't pulling it in, they shouldn't be
2013-03-09 17:26:16 -05:00
Mike Bayer d9d6dcea77 add future 2012-12-11 10:34:33 -05:00
Mike Bayer 70d38af42e Fixed table reflection for Oracle when accessing a synonym that refers
to a DBLINK remote database; while the syntax has been present in the
Oracle dialect for some time, up until now it has never been tested.
The syntax has been tested against a sample database linking to itself,
however there's still some uncertainty as to what should be used for the
"owner" when querying the remote database for table information.
Currently, the value of "username" from user_db_links is used to
match the "owner".  [ticket:2619]
2012-12-09 18:28:08 -05:00
Mike Bayer 9d817406e2 The Oracle LONG type, while an unbounded text type, does not appear
to use the cx_Oracle.LOB type when result rows are returned,
so the dialect has been repaired to exclude LONG from
having cx_Oracle.LOB filtering applied.  Also in 0.7.10.
[ticket:2620]
2012-12-06 19:30:49 -05:00
Mike Bayer af1a545bdd Repaired the usage of `.prepare()` in conjunction with
cx_Oracle so that a return value of ``False`` will result
in no call to ``connection.commit()``, hence avoiding
"no transaction" errors.   Two-phase transactions have
now been shown to work in a rudimental fashion with
SQLAlchemy and cx_oracle, however are subject to caveats
observed with the driver; check the documentation
for details.  Also in 0.7.10.
[ticket:2611]
2012-12-06 19:10:06 -05:00
Mike Bayer 6397a4ff4b Fixed bug in type_coerce() whereby typing information
could be lost if the statement were used as a subquery
inside of another statement, as well as other similar
situations.  Among other things, would cause
typing information to be lost when the Oracle/mssql dialects
would apply limit/offset wrappings. [ticket:2603]
2012-11-12 15:48:40 -05:00
Mike Bayer bba1d01b26 - [bug] The CreateIndex construct in Oracle
will now schema-qualify the name of the index
    to be that of the parent table.  Previously this
    name was omitted which apparently creates the
    index in the default schema, rather than that
    of the table.
2012-09-30 20:00:46 +00:00
Mike Bayer bd48c8a9ec pg and oracle fixes 2012-09-30 01:02:56 -04:00
Mike Bayer be40b51cb0 getting everything to pass again 2012-09-27 16:33:54 -04:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
2012-09-27 02:37:33 -04:00
Mike Bayer d3e60f805d - [feature] The types of columns excluded from the
setinputsizes() set can be customized by sending
    a list of string DBAPI type names to exclude.
   This list was previously fixed.  The list also
    now defaults to STRING, UNICODE, removing
    CLOB, NCLOB from the list.  [ticket:2469]
2012-09-05 18:11:33 -04:00
Mike Bayer b48e0147ab - refine oracle returning some more to use purely positional approach 2012-08-25 20:08:52 +00:00
Mike Bayer 567ea2faef - merge 2012-08-25 19:41:43 +00:00
Mike Bayer 4d40f1b71e - more oracle tweaks for returning; the method here is still kind of brittle and might have issues with
pks, multiple function calls
2012-08-25 19:41:14 +00:00
Mike Bayer e4ff3d2a35 oracle fixes... 2012-08-25 14:19:47 -04:00
Mike Bayer 885cae7998 a few oracle fixes 2012-08-25 12:00:11 -04:00
Mike Bayer 8f5a31441a - [bug] Fixed cextension bug whereby the
"ambiguous column error" would fail to
function properly if the given index were
a Column object and not a string.
Note there are still some column-targeting
issues here which are fixed in 0.8.
[ticket:2553]
- find more cases where column targeting is being inaccurate, add
more information to result_map to better differentiate "ambiguous"
results from "present" or "not present".  In particular, result_map
is sensitive to dupes, even though no error is raised; the conflicting
columns are added to the "obj" member of the tuple so that the two
are both directly accessible in the result proxy
- handwringing over the damn "name fallback" thing in results.  can't
really make it perfect yet
- fix up oracle returning clause.  not sure why its guarding against
labels, remove that for now and see what the bot says.
2012-08-22 18:41:46 -04:00
Mike Bayer 27913554a8 trailing whitespace bonanza 2012-07-28 15:50:05 -04:00
Mike Bayer c3a0453680 - [bug] Quoting information is now passed along
from a Column with quote=True when generating
    a same-named bound parameter to the bindparam()
    object, as is the case in generated INSERT and UPDATE
    statements, so that unknown reserved names can
    be fully supported.  [ticket:2437]
2012-05-04 18:40:55 -04:00
Mike Bayer 04c7bae308 - test failures. one in particular seems to be a weird oursql bug, oh well 2012-02-12 20:00:44 -05:00