summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
* - Fixed bug where :meth:`.in_()` would go into an endless loop ifMike Bayer2014-02-131-2/+6
| | | | | | erroneously passed a column expression whose comparator included the ``__getitem__()`` method, such as a column that uses the :class:`.postgresql.ARRAY` type. [ticket:2957]
* docsMike Bayer2014-01-261-35/+131
|
* updatesMike Bayer2014-01-261-63/+92
|
* tweak textMike Bayer2014-01-251-4/+10
|
* importsMike Bayer2014-01-251-0/+4
|
* caseMike Bayer2014-01-251-44/+136
|
* - start building out very comprehensive docstrings for core functionsMike Bayer2014-01-251-106/+445
|
* docuemnt joinMike Bayer2014-01-241-16/+87
|
* - Fixed issue where a primary key column that has a Sequence on it,Mike Bayer2013-12-201-1/+7
| | | | | | | | | yet the column is not the "auto increment" column, either because it has a foreign key constraint or ``autoincrement=False`` set, would attempt to fire the Sequence on INSERT for backends that don't support sequences, when presented with an INSERT missing the primary key value. This would take place on non-sequence backends like SQLite, MySQL. [ticket:2896]
* - Fixed bug with :meth:`.Insert.from_select` method where the orderMike Bayer2013-12-192-5/+20
| | | | | | | | of the given names would not be taken into account when generating the INSERT statement, thus producing a mismatch versus the column names in the given SELECT statement. Also noted that :meth:`.Insert.from_select` implies that Python-side insert defaults cannot be used, since the statement has no VALUES clause. [ticket:2895]
* - for [ticket:2651], leaving CheckConstraint alone, preferring to keepMike Bayer2013-12-161-2/+3
| | | | | | | | | | | | backwards compatibility. A note about backslashing escapes is added. Because the Text() construct now supports bind params better, the example given in the code raises an exception now, so that should cover us. The exception itself has been enhanced to include the key name of the bound param. We're backporting this to 0.8 but 0.8 doesn't have the text->bind behavior that raises. Conflicts: lib/sqlalchemy/sql/schema.py
* Ensure API generation and fix cross referencesVraj Mohan2013-11-141-2/+5
|
* - Fixed bug where :func:`.type_coerce` would not interpret ORMMike Bayer2013-10-211-2/+2
| | | | | | | | elements with a ``__clause_element__()`` method properly. [ticket:2849] Conflicts: lib/sqlalchemy/sql/elements.py
* - add a type_coerce() step within Enum, Boolean to the CHECK constraint,Mike Bayer2013-10-201-0/+3
| | | | | | | | | | | | so that the custom type isn't exposed to an operation that is against the "impl" type's constraint, [ticket:2842] - this change showed up as some recursion overflow in pickling with labels, add a __reduce__() there....pickling of expressions is less and less something that's very viable... Conflicts: lib/sqlalchemy/sql/elements.py lib/sqlalchemy/sql/sqltypes.py
* workaround for #2838 here. still need to figure out why an ENUM test is ↵Mike Bayer2013-10-141-0/+7
| | | | suddenly hitting this.
* - Fixed bug in default compiler plus those of postgresql, mysql, andMike Bayer2013-10-122-3/+6
| | | | | | | | | | | 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. Conflicts: lib/sqlalchemy/sql/util.py
* A :func:`.select` that is made to refer to itself in its FROM clause,Mike Bayer2013-10-081-0/+3
| | | | | | | | | typically via in-place mutation, will raise an informative error message rather than causing a recursion overflow. [ticket:2815] Conflicts: lib/sqlalchemy/sql/selectable.py
* Fixed bug where using an annotation such as :func:`.remote` orMike Bayer2013-10-081-1/+6
| | | | | | | | | | :func:`.foreign` on a :class:`.Column` before association with a parent :class:`.Table` could produce issues related to the parent table not rendering within joins, due to the inherent copy operation performed by an annotation. [ticket:2813] Conflicts: lib/sqlalchemy/sql/elements.py
* added "system=True" to Column, so that we generally don't have to botherMike Bayer2013-08-251-0/+3
| | | | with CreateColumn rules
* - The :class:`.CreateColumn` construct can be appled to a customMike Bayer2013-08-241-3/+5
| | | | | | | | | compilation rule which allows skipping of columns, by producing a rule that returns ``None``. Also in 0.8.3. Conflicts: doc/build/changelog/changelog_09.rst lib/sqlalchemy/sql/ddl.py
* additoinalMike Bayer2013-08-211-2/+18
| | | | | | cherry pick of 9302be39a5f40b537ff43e1990c7a210c464cf1c from 0.9 Conflicts: lib/sqlalchemy/sql/selectable.py
* Fixed regression dating back to 0.7.9 whereby the name of a CTE mightMike Bayer2013-08-181-1/+1
| | | | | | | | not be properly quoted if it was referred to in multiple FROM clauses. Also in 0.8.3, 0.7.11. [ticket:2801] Conflicts: doc/build/changelog/changelog_09.rst
* - The :meth:`.Operators.notin_` operator added in 0.8 now properlyMike Bayer2013-08-071-1/+4
| | | | | 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-312-12/+18
| | | | | | used only as an ``alias()`` construct, it would not render using the WITH keyword. Also in 0.7.11. [ticket:2783]
* Fixed bug in :class:`.CheckConstraint` DDL where the "quote" flag from aMike Bayer2013-07-171-1/+3
| | | | | :class:`.Column` object would not be propagated. Also in 0.8.3, 0.7.11. [ticket:2784]
* - use inline=True for the insert..select here so it works on oracleMike Bayer2013-07-121-0/+11
|
* Fixed bug where the expression system relied upon the ``str()``Mike Bayer2013-07-123-5/+23
| | | | | | | | | | | | 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. [ticket:2780]
* - Added new method to the :func:`.insert` constructMike Bayer2013-07-052-3/+52
| | | | | | | | | | :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.
* Fixed bug when using multi-table UPDATE where a supplementalMike Bayer2013-07-021-2/+2
| | | | | | | 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]
* - rework of correlation, continuing on #2668, #2746Mike Bayer2013-06-262-65/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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. Conflicts: doc/build/changelog/changelog_08.rst doc/build/changelog/changelog_09.rst lib/sqlalchemy/sql/compiler.py
* Provided a new attribute for :class:`.TypeDecorator`Mike Bayer2013-06-221-2/+5
| | | | | | | | | | | | 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] Conflicts: doc/build/changelog/changelog_09.rst
* - remove the ``__iter__()`` with notimplemented since it interferesMike Bayer2013-06-031-5/+0
| | | | | | | with legitimate iterable detection, [ticket:2726] Conflicts: doc/build/changelog/changelog_09.rst
* fix this testMike Bayer2013-05-261-1/+1
|
* Show the conflicting column in the warning!Chris Withers2013-05-261-2/+2
|
* heh dont need that eitherMike Bayer2013-04-251-7/+1
|
* dont need thisMike Bayer2013-04-251-6/+0
|
* everything passes with this!!!!!!! holy crap !!!!! and its the simplest of allMike Bayer2013-04-252-3/+15
|
* Fully implemented the IS and IS NOT operators withMike Bayer2013-04-221-12/+34
| | | | | | | | | | 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]
* A major fix to the way in which a select() object producesMike Bayer2013-04-112-22/+58
| | | | | | | | | | | | | | | | | | | 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]
* - Fixed bug in unit of work whereby a joined-inheritanceMike Bayer2013-04-011-1/+3
| | | | | | | | | | | subclass could insert the row for the "sub" table before the parent table, if the two tables had no ForeignKey constraints set up between them. Also in 0.7.11. [ticket:2689] - fix a glitch in the assertsql.CompiledSQL fixture regarding when a multiparam compiledSQL is used within an AllOf - add a new utility function randomize_unitofwork() which does the function of --reversetop
* merge plus fix the test spelling tooMike Bayer2013-03-181-1/+1
|\
| * Fix typo.Richard Mitchell2013-03-181-1/+1
| |
* | no need to use getattr() hereMike Bayer2013-03-172-3/+5
|/
* doc updatesMike Bayer2013-03-111-29/+29
|
* - repair doctest for SQL expression tutorialMike Bayer2013-03-111-1/+35
| | | | | | | | - remove most use of "whereclause" and "from_obj", not done yet, part of [ticket:2679] - add links to method chained versions for all Select.append_XYZ() calls - add "method chaining" and "generative" to glossary
* A meaningful :attr:`.QueryableAttribute.info` attribute isMike Bayer2013-03-091-0/+3
| | | | | | | | added, which proxies down to the ``.info`` attribute on either the :class:`.schema.Column` object if directly present, or the :class:`.MapperProperty` otherwise. The full behavior is documented and ensured by tests to remain stable. [ticket:2675]
* - since correlation is now always at least semi-automatic, remove theMike Bayer2013-03-091-28/+30
| | | | | | ability for correlation to have any effect for a SELECT that's stated in the FROM. - add a new exhaustive test suite for correlation to test_compiler
* Changed behavior of Select.correlate() to ignore correlations to froms that ↵Luke Cyca2013-03-072-32/+36
| | | | don't exist in the superquery.
* - A clear error message is emitted if an event handlerMike Bayer2013-02-251-1/+8
| | | | | | | | | | attempts to emit SQL on a Session within the after_commit() handler, where there is not a viable transaction in progress. [ticket:2662] - rework how SessionTransaction maintains state, using symbols instead. - add lots of notes and cross-linking for session events. - add a link to :func:`.select()` within :meth:`.FromClause.select`.
* Fixed the consideration of the ``between()`` operatorMike Bayer2013-02-021-1/+1
| | | | | | so that it works correctly with the new relationship local/remote system. [ticket:1768]