summaryrefslogtreecommitdiff
path: root/test/sql
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | | | magic accessors to the rescueMike Bayer2013-05-271-13/+0
| | | |
* | | | still not locating more nested expressions, may need to match on nameMike Bayer2013-05-271-11/+29
| | | |
* | | | attempt number one, doesn't detect though if the label in the order by is ↵Mike Bayer2013-05-271-0/+63
| |_|/ |/| | | | | | | | not directly present there.
* | | fix this testMike Bayer2013-05-261-1/+1
| |/ |/|
* | cleanupMike Bayer2013-05-041-67/+68
| |
* | formatting stuffMike Bayer2013-05-041-49/+51
|/
* Fully implemented the IS and IS NOT operators withMike Bayer2013-04-221-1/+28
| | | | | | | | | | regards to the True/False constants. An expression like ``col.is_(True)`` will now render ``col IS true`` on the target platform, rather than converting the True/ False constant to an integer bound parameter. This allows the ``is_()`` operator to work on MySQL when given True/False constants. [ticket:2682]
* - Improvements to the operation of the pymysql dialect onMike Bayer2013-04-211-20/+6
| | | | | | | | Python 3, including some important decode/bytes steps. Issues remain with BLOB types due to driver issues. Courtesy Ben Trofatter. - start using util.py3k, we will eventually remove the sa2to3 fixer entirely
* Merged in bentrofatter/sqlalchemy-2663 (pull request #49)Mike Bayer2013-04-211-1/+10
|\ | | | | | | Fixed PyMySQL problems for Python 2.x and mitigated some issues with Python 3.x
| * Removed commented line from test_types.pyBen Trofatter2013-03-191-1/+0
| |
| * Added workaround for pymysql3 double wrapping ProgrammingErrors to pymysql ↵Ben Trofatter2013-03-181-1/+11
| | | | | | | | | | | | dialect. Added workaround for pymysql3 return a bytes object when queried for isolation level.
* | A major fix to the way in which a select() object producesMike Bayer2013-04-112-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | labeled columns when apply_labels() is used; this mode produces a SELECT where each column is labeled as in <tablename>_<columnname>, to remove column name collisions for a multiple table select. The fix is that if two labels collide when combined with the table name, i.e. "foo.bar_id" and "foo_bar.id", anonymous aliasing will be applied to one of the dupes. This allows the ORM to handle both columns independently; previously, 0.7 would in some cases silently emit a second SELECT for the column that was "duped", and in 0.8 an ambiguous column error would be emitted. The "keys" applied to the .c. collection of the select() will also be deduped, so that the "column being replaced" warning will no longer emit for any select() that specifies use_labels, though the dupe key will be given an anonymous label which isn't generally user-friendly. [ticket:2702]
* | - reinstate insert returning back into test_insert.py; defaultdialectMike Bayer2013-04-012-4/+10
| | | | | | | | needs to be explicit here since tablestest sticks testing.db onto metadata.bind
* | moving insert returning test back into CRUD test class until I figure out ↵Diana Clarke2013-03-302-7/+5
| | | | | | | | why moving it broke the oracle/postgres builds