summaryrefslogtreecommitdiff
path: root/test/sql
Commit message (Collapse)AuthorAgeFilesLines
* repair missing oracle skipMike Bayer2013-08-281-1/+1
|
* - these tests now fail on a normalize name DB, as they should! because we're ↵Mike Bayer2013-08-281-0/+6
| | | | quoting the lowercase name.
* callcountsMike Bayer2013-08-271-1/+1
|
* - cx_oracle seems to have a bug here though it is hard to track downMike Bayer2013-08-271-12/+14
| | | | - cx_oracle dialect doesn't use normal col names, lets just not rely on that for now
* - A rework to the way that "quoted" identifiers are handled, in thatMike Bayer2013-08-272-16/+165
| | | | | | | | | | | | | | | | instead of relying upon various ``quote=True`` flags being passed around, these flags are converted into rich string objects with quoting information included at the point at which they are passed to common schema constructs like :class:`.Table`, :class:`.Column`, etc. This solves the issue of various methods that don't correctly honor the "quote" flag such as :meth:`.Engine.has_table` and related methods. The :class:`.quoted_name` object is a string subclass that can also be used explicitly if needed; the object will hold onto the quoting preferences passed and will also bypass the "name normalization" performed by dialects that standardize on uppercase symbols, such as Oracle, Firebird and DB2. The upshot is that the "uppercase" backends can now work with force-quoted names, such as lowercase-quoted names and new reserved words. [ticket:2812]
* - ensure rowcount is returned for an UPDATE with no implicit returningMike Bayer2013-08-251-1/+1
| | | | | - modernize test for that - use py3k compatible next() in test_returning/test_versioning
* - The ``version_id_generator`` parameter of ``Mapper`` can now be specifiedMike Bayer2013-08-251-0/+122
| | | | | | | | | | | | | | | | | | | | | to rely upon server generated version identifiers, using triggers or other database-provided versioning features, by passing the value ``False``. The ORM will use RETURNING when available to immediately load the new version identifier, else it will emit a second SELECT. [ticket:2793] - The ``eager_defaults`` flag of :class:`.Mapper` will now allow the newly generated default values to be fetched using an inline RETURNING clause, rather than a second SELECT statement, for backends that support RETURNING. - Added a new variant to :meth:`.ValuesBase.returning` called :meth:`.ValuesBase.return_defaults`; this allows arbitrary columns to be added to the RETURNING clause of the statement without interfering with the compilers usual "implicit returning" feature, which is used to efficiently fetch newly generated primary key values. For supporting backends, a dictionary of all fetched values is present at :attr:`.ResultProxy.returned_defaults`. - add a glossary entry for RETURNING - add documentation for version id generation, [ticket:867]
* forgot to add system to the copy() methodMike Bayer2013-08-251-0/+7
| | | | | Conflicts: lib/sqlalchemy/schema.py
* added "system=True" to Column, so that we generally don't have to botherMike Bayer2013-08-251-0/+9
| | | | with CreateColumn rules
* Fixed regression dating back to 0.7.9 whereby the name of a CTE mightMike Bayer2013-08-181-0/+16
| | | | | not be properly quoted if it was referred to in multiple FROM clauses. Also in 0.8.3, 0.7.11. [ticket:2801]
* - A large refactoring of the ``sqlalchemy.sql`` package has reorganizedMike Bayer2013-08-121-0/+176
| | | | | | | | | | | | | | | | | | | | | | the import structure of many core modules. ``sqlalchemy.schema`` and ``sqlalchemy.types`` remain in the top-level package, but are now just lists of names that pull from within ``sqlalchemy.sql``. Their implementations are now broken out among ``sqlalchemy.sql.type_api``, ``sqlalchemy.sql.sqltypes``, ``sqlalchemy.sql.schema`` and ``sqlalchemy.sql.ddl``, the last of which was moved from ``sqlalchemy.engine``. ``sqlalchemy.sql.expression`` is also a namespace now which pulls implementations mostly from ``sqlalchemy.sql.elements``, ``sqlalchemy.sql.selectable``, and ``sqlalchemy.sql.dml``. Most of the "factory" functions used to create SQL expression objects have been moved to classmethods or constructors, which are exposed in ``sqlalchemy.sql.expression`` using a programmatic system. Care has been taken such that all the original import namespaces remain intact and there should be no impact on any existing applications. The rationale here was to break out these very large modules into smaller ones, provide more manageable lists of function names, to greatly reduce "import cycles" and clarify the up-front importing of names, and to remove the need for redundant functions and documentation throughout the expression package.
* - The :meth:`.Operators.notin_` operator added in 0.8 now properlyMike Bayer2013-08-071-0/+11
| | | | | produces the negation of the expression "IN" returns when used against an empty collection. Also in 0.8.3.
* - Fixed bug in common table expression system where if the CTE wereMike Bayer2013-07-311-0/+29
| | | | | | used only as an ``alias()`` construct, it would not render using the WITH keyword. Also in 0.8.3, 0.7.11. [ticket:2783]
* - fix issue in join rewriting whereby we need to ensure the .key and .nameMike Bayer2013-07-271-4/+83
| | | | | | are transferred correctly for when .key is present; tests have been enhanced to test this condition for render, result map construction, statement execution. [ticket:2790]
* Fixed bug in :class:`.CheckConstraint` DDL where the "quote" flag from aMike Bayer2013-07-171-0/+23
| | | | | :class:`.Column` object would not be propagated. Also in 0.8.3, 0.7.11. [ticket:2784]
* Fixed bug where the expression system relied upon the ``str()``Mike Bayer2013-07-122-0/+53
| | | | | | | | | | | | form of a some expressions when referring to the ``.c`` collection on a ``select()`` construct, but the ``str()`` form isn't available since the element relies on dialect-specific compilation constructs, notably the ``__getitem__()`` operator as used with a Postgresql ``ARRAY`` element. The fix also adds a new exception class :class:`.UnsupportedCompilationError` which is raised in those cases where a compiler is asked to compile something it doesn't know how to. Also in 0.8.3. [ticket:2780]
* - we dont actually need this unicode cast, on py3k + linux it seems theMike Bayer2013-07-091-0/+2
| | | | | has_table issues are OK. On OSX forget it. - still some issues with PY3k + pyodbc + decimal values it doesn't expect, not sure
* - Added new method to the :func:`.insert` constructMike Bayer2013-07-051-1/+64
| | | | | | | | | | :meth:`.Insert.from_select`. Given a list of columns and a selectable, renders ``INSERT INTO (table) (columns) SELECT ..``. While this feature is highlighted as part of 0.9 it is also backported to 0.8.3. [ticket:722] - The :func:`.update`, :func:`.insert`, and :func:`.delete` constructs will now interpret ORM entities as FROM clauses to be operated upon, in the same way that select() already does. Also in 0.8.3.
* Fixed bug when using multi-table UPDATE where a supplementalMike Bayer2013-07-021-0/+39
| | | | | | | table is a SELECT with its own bound parameters, where the positioning of the bound parameters would be reversed versus the statement itself when using MySQL's special syntax. [ticket:2768]
* add an ORDER BY hereMike Bayer2013-06-261-2/+2
|
* - rework of correlation, continuing on #2668, #2746Mike Bayer2013-06-262-12/+142
| | | | | | | | | | | | | | | | | | | | | | | | - add support for correlations to propagate all the way in; because correlations require context now, need to make sure a select enclosure of any level takes effect any number of levels deep. - fix what we said correlate_except() was supposed to do when we first released #2668 - "the FROM clause is left intact if the correlated SELECT is not used in the context of an enclosing SELECT..." - it was not considering the "existing_froms" collection at all, and prohibited additional FROMs from being placed in an any() or has(). - add test for multilevel any() - lots of docs, including glossary entries as we really need to define "WHERE clause", "columns clause" etc. so that we can explain correlation better - based on the insight that a SELECT can correlate anything that ultimately came from an enclosing SELECT that links to this one via WHERE/columns/HAVING/ORDER BY, have the compiler keep track of the FROM lists that correspond in this way, link it to the asfrom flag, so that we send to _get_display_froms() the exact list of candidate FROMs to correlate. no longer need any asfrom logic in the Select() itself - preserve 0.8.1's behavior for correlation when no correlate options are given, not to mention 0.7 and prior's behavior of not propagating implicit correlation more than one level.. this is to reduce surprises/hard-to-debug situations when a user isn't trying to correlate anything.
* tweak this for now, would need a testMike Bayer2013-06-231-11/+0
|
* The resolution of :class:`.ForeignKey` objects to theirMike Bayer2013-06-232-35/+321
| | | | | | | | | | | | | | | | | | target :class:`.Column` has been reworked to be as immediate as possible, based on the moment that the target :class:`.Column` is associated with the same :class:`.MetaData` as this :class:`.ForeignKey`, rather than waiting for the first time a join is constructed, or similar. This along with other improvements allows earlier detection of some foreign key configuration issues. Also included here is a rework of the type-propagation system, so that it should be reliable now to set the type as ``None`` on any :class:`.Column` that refers to another via :class:`.ForeignKey` - the type will be copied from the target column as soon as that other column is associated, and now works for composite foreign keys as well. [ticket:1765]
* Provided a new attribute for :class:`.TypeDecorator`Mike Bayer2013-06-221-1/+33
| | | | | | | | | called :attr:`.TypeDecorator.coerce_to_is_types`, to make it easier to control how comparisons using ``==`` or ``!=`` to ``None`` and boolean types goes about producing an ``IS`` expression, or a plain equality expression with a bound parameter. [ticket:2744]
* - tests for the alias() APIMike Bayer2013-06-081-1/+74
| | | | - docs docs docs
* fix testMike Bayer2013-06-061-0/+1
|
* genericize tests hereMike Bayer2013-06-041-5/+10
|
* Merge branch 'ticket_2587'Mike Bayer2013-06-042-15/+311
|\ | | | | | | | | | | Conflicts: test/profiles.txt test/sql/test_selectable.py
| * - add coverage for result map rewritingMike Bayer2013-06-041-0/+6
| | | | | | | | | | - fix the result map rewriter for col mismatches, since the rewritten select at the moment typically has more columns than the original
| * - if the select() does not have use_labels on, then we just renderMike Bayer2013-06-041-0/+51
| | | | | | | | | | | | the joins as is, regardless of the dialect not supporting it. use_labels=True indicates a higher level of automation and also can maintain the labels between rewritten and not. use_labels=False indicates a manual use case.
| * - support for a__b_dc, i.e. two levels of nestingMike Bayer2013-06-041-35/+131
| |
| * repair these tests now that we allow join from selectable to fromgroupingMike Bayer2013-06-041-21/+26
| |
| * - add a flag to DefaultDialect for this so that people will have someMike Bayer2013-06-041-1/+28
| | | | | | | | workaround
| * rewriting scheme now works.Mike Bayer2013-06-041-28/+21
| |
| * capture the really hard one in a test (hooray)Mike Bayer2013-06-041-0/+119
| |
* | Fixed bug whereby joining a select() of a table "A" with multipleMike Bayer2013-06-032-7/+40
| | | | | | | | | | | | | | | | foreign key paths to a table "B", to that table "B", would fail to produce the "ambiguous join condition" error that would be reported if you join table "A" directly to "B"; it would instead produce a join condition with multiple criteria. [ticket:2738]
* | - remove the ``__iter__()`` with notimplemented since it interferesMike Bayer2013-06-031-7/+6
| | | | | | | | with legitimate iterable detection, [ticket:2726]
* | test tweakMike Bayer2013-06-031-1/+4
| |
* | Merge branch 'master' into ticket_1068Mike Bayer2013-06-0312-175/+153
|\ \
| * | - some tweaks to try to help out mssql+pyodbc support a bit, py3k is reallyMike Bayer2013-06-031-2/+0
| |/ | | | | | | not happening too well (I need to stick with linux + freetds 0.91, I know)
| * Merge branch 'master' into rel_0_9Mike Bayer2013-05-261-1/+1
| |\
| * \ merge defaultMike Bayer2013-05-051-0/+2
| |\ \
| * | | - OK we have -w sql passing for: sqlite, postgresql, oursql 2.7 + 3.3, ↵Mike Bayer2013-05-041-1/+1
| | | | | | | | | | | | | | | | mysqldb 2.7
| * | | and int types here...Mike Bayer2013-05-041-1/+2
| | | |
| * | | update testMike Bayer2013-05-041-12/+3
| | | |
| * | | cleanup and formattingMike Bayer2013-05-041-67/+68
| | | |
| * | | - unicode literals need to just be handled differently if they have utf-8Mike Bayer2013-05-042-42/+44
| | | | | | | | | | | | | | | | | | | | encoded in them vs. unicode escaping. not worth figuring out how to combine these right now
| * | | formatting stuffMike Bayer2013-05-041-49/+51
| | | |
| * | | - test_types, test_compiler, with sqlite at leastMike Bayer2013-04-282-48/+25
| | | |
| * | | - the raw 2to3 runMike Bayer2013-04-2712-169/+176
| | | | | | | | | | | | | | | | - went through examples/ and cleaned out excess list() calls