summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
* 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]
* Fixed a bug regarding column annotations which in particularMike Bayer2013-02-021-1/+1
| | | | | | | | could impact some usages of the new :func:`.orm.remote` and :func:`.orm.local` annotation functions, where annotations could be lost when the column were used in a subsequent expression. [ticket:2660]
* The :meth:`.ColumnOperators.in_` operator will now coerceMike Bayer2013-02-021-0/+2
| | | | | values of ``None`` to :func:`.null`. [ticket:2496]
* - add full docs for like()/ilike()Mike Bayer2013-01-281-0/+28
|
* #2629Mike Bayer2013-01-251-0/+5
| | | | | insert().returning() raises an informative CompileError if attempted to compile on a dialect that doesn't support RETURNING.
* :class:`.Index` now supports arbitrary SQL expressions and/orMike Bayer2013-01-161-15/+26
| | | | | | | | functions, in addition to straight columns. Common modifiers include using ``somecolumn.desc()`` for a descending index and ``func.lower(somecolumn)`` for a case-insensitive index, depending on the capabilities of the target backend. [ticket:695]
* Tweaked the "REQUIRED" symbol used by the compiler to identifyMike Bayer2013-01-081-5/+14
| | | | | | INSERT/UPDATE bound parameters that need to be passed, so that it's more easily identifiable when writing custom bind-handling code. [ticket:2648]
* happy new year (see #2645)Diana Clarke2013-01-017-7/+7
|
* Fixed bug whereby using a label_length on dialect that was smallerMike Bayer2012-12-081-6/+11
| | | | | | than the size of actual column identifiers would fail to render the columns correctly in a SELECT statement. [ticket:2610]
* internally at least refer to multirow as "multivalues", to distinguish betweenMike Bayer2012-12-081-1/+1
| | | | | an INSERT that's used in executemany() as opposed to one which has a VALUES clause with multiple entries.
* - multivalued inserts, [ticket:2623]Mike Bayer2012-12-082-125/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - update "not supported" messages for empty inserts, mutlivalue inserts - rework the ValuesBase approach for multiple value sets so that stmt.parameters does store a list for multiple values; the _has_multiple_parameters flag now indicates which of the two modes the statement is within. it now raises exceptions if a subsequent call to values() attempts to call a ValuesBase with one mode in the style of the other mode; that is, you can't switch a single- or multi- valued ValuesBase to the other mode, and also if a multiple value is passed simultaneously with a kwargs set. Added tests for these error conditions - Calling values() multiple times in multivalue mode now extends the parameter list to include the new parameter sets. - add error/test if multiple *args were passed to ValuesBase.values() - rework the compiler approach for multivalue inserts, back to where _get_colparams() returns the same list of (column, value) as before, thereby maintaining the identical number of append() and other calls when multivalue is not enabled. In the case of multivalue, it makes a last-minute switch to return a list of lists instead of the single list. As it constructs the additional lists, the inline defaults and other calculated default parameters of the first parameter set are copied into the newly generated lists so that these features continue to function for a multivalue insert. Multivalue inserts now add no additional function calls to the compilation for regular insert constructs. - parameter lists for multivalue inserts now includes an integer index for all parameter sets. - add detailed documentation for ValuesBase.values(), including careful wording to describe the difference between multiple values and an executemany() call. - add a test for multivalue insert + returning - it works ! - remove the very old/never used "postgresql_returning"/"firebird_returning" flags.
* merge latest defaultMike Bayer2012-12-082-6/+15
|\