summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
* - ensure kwargs are passed for limit clause on a compound select as well,Mike Bayer2014-10-311-1/+1
| | | | further fixes for #3034
* - changelog for pullreq github:139Mike Bayer2014-10-211-4/+22
| | | | | - add support for self-referential foreign keys to move over as well when the table name is changed.
* Merge remote-tracking branch 'origin/pr/139' into pr139Mike Bayer2014-10-211-4/+7
|\
| * allow Table.tometadata changing the table namendparker2014-09-231-4/+7
| |
* | - Reversing a change that was made in 0.9, the "singleton" natureMike Bayer2014-10-192-17/+13
| | | | | | | | | | | | | | | | | | of the "constants" :func:`.null`, :func:`.true`, and :func:`.false` has been reverted. These functions returning a "singleton" object had the effect that different instances would be treated as the same regardless of lexical use, which in particular would impact the rendering of the columns clause of a SELECT statement. fixes #3170
* | Fixed typopr/142mozillazg2014-10-151-2/+2
| |
* | Merge remote-tracking branch 'origin/pr/140' into pr140Mike Bayer2014-10-112-3/+3
|\ \
| * | cleanup exception handling - use new exception hierarchy (since python 2.5)pr/140ndparker2014-10-021-3/+1
| | |
| * | improve exception vs. exit handlingndparker2014-09-232-2/+4
| |/
* | - :meth:`.Insert.from_select` now includes Python and SQL-expressionMike Bayer2014-10-103-29/+96
| | | | | | | | | | | | | | defaults if otherwise unspecified; the limitation where non- server column defaults aren't included in an INSERT FROM SELECT is now lifted and these expressions are rendered as constants into the SELECT statement.
* | - apply patches to correct for + sign in with_hint() docs,Mike Bayer2014-10-101-3/+2
| | | | | | | | fixes #3036
* | - Fixed bug where a fair number of SQL elements withinMike Bayer2014-10-091-1/+2
| | | | | | | | | | | | | | | | the sql package would fail to ``__repr__()`` successfully, due to a missing ``description`` attribute that would then invoke a recursion overflow when an internal AttributeError would then re-invoke ``__repr__()``. fixes #3195
* | - changelog, migration for pr github:134Mike Bayer2014-10-042-1/+37
| |
* | Merge remote-tracking branch 'origin/pr/134' into pr134Mike Bayer2014-10-045-2/+118
|\ \
| * | method documentation typo fixpr/134Ilja Everilä2014-09-111-1/+1
| | |
| * | documentation indentation fixIlja Everilä2014-09-111-2/+2
| | |
| * | allow windowing filtered functionsIlja Everilä2014-09-111-0/+20
| | |
| * | renamed aggregatefilter to funcfilter, since it is thatIlja Everilä2014-09-115-23/+23
| | |
| * | implementation for <aggregate_fun> FILTER (WHERE ...)Ilja Everilä2014-09-105-2/+98
| | |
* | | - cyclomatic complexity; break up visit_select, goes from F to DMike Bayer2014-09-271-52/+69
| | |
* | | - cyclomatic complexity: _get_colparams() becomes sql.crud._get_crud_params,Mike Bayer2014-09-272-421/+511
| | | | | | | | | | | | CC goes from F to D
* | | - cyclomatic complexity: _join_condition goes from E to a BMike Bayer2014-09-271-43/+54
| | |
* | | - refactor of declarative, break up into indiviudal methodsMike Bayer2014-09-251-2/+4
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that are now affixed to _MapperConfig - declarative now creates column copies ahead of time so that they are ready to go for a declared_attr - overhaul of declared_attr; memoization, cascading modifier - A relationship set up with :class:`.declared_attr` on a :class:`.AbstractConcreteBase` base class will now be configured on the abstract base mapping automatically, in addition to being set up on descendant concrete classes as usual. fixes #2670 - The :class:`.declared_attr` construct has newly improved behaviors and features in conjunction with declarative. The decorated function will now have access to the final column copies present on the local mixin when invoked, and will also be invoked exactly once for each mapped class, the returned result being memoized. A new modifier :attr:`.declared_attr.cascading` is added as well. fixes #3150 - the original plan for #3150 has been scaled back; by copying mixin columns up front and memoizing, we don't actually need the "map properties later" thing. - full docs + migration notes
* | - Added new method :meth:`.Select.with_statement_hint` and ORMMike Bayer2014-09-182-4/+44
|/ | | | | | method :meth:`.Query.with_statement_hint` to support statement-level hints that are not specific to a table. fixes #3206
* - add in all the method-chained methods to the parameter descriptionsMike Bayer2014-09-091-43/+131
| | | | | on select(). improve some descriptions and add more info for limit()/ offset(), including new 1.0 functionality.
* - rework the previous "order by" system in terms of the new one,Mike Bayer2014-09-084-44/+84
| | | | | | | | unify everything. - create a new layer of separation between the "from order bys" and "column order bys", so that an OVER doesn't ORDER BY a label in the same columns clause - identify another issue with polymorphic for ref #3148, match on label keys rather than the objects
* - rework ColumnAdapter and ORMAdapter to only provide the featuresticket_3148Mike Bayer2014-09-072-78/+69
| | | | | | | | | | | we're now using; rework them fully so that their behavioral contract is consistent regarding adapter.traverse() vs. adapter.columns[], add a full suite of tests including advanced wrapping scenarios previously only covered by test/orm/test_froms.py and test/orm/inheritance/test_relationships.py - identify several cases where label._order_by_label_clause would be corrupted, e.g. due to adaption or annotation separately - add full tests for #3148
* - enhance ClauseAdapter / ColumnAdapter to have new behaviors with labels.Mike Bayer2014-09-073-21/+33
| | | | | | | | | | | | | | | | | | | | | The "anonymize label" logic is now generalized to ClauseAdapter, and takes place when the anonymize_labels flag is sent, taking effect for all .columns lookups as well as within traverse() calls against the label directly. - traverse() will also memoize what it gets in columns, so that calling upon traverse() / .columns against the same Label will produce the same anonymized label. This is so that AliasedClass produces the same anonymized label when it is accessed per-column (e.g. SomeAlias.some_column) as well as when it is applied to a Query, and within column loader strategies (e.g. query(SomeAlias)); the former uses traverse() while the latter uses .columns - AliasedClass now calls onto ColumnAdapter - Query also makes sure to use that same ColumnAdapter from the AliasedClass in all cases - update the logic from 0.9 in #1068 to make use of the same _label_resolve_dict we use for #2992, simplifying how that works and adding support for new scenarios that were pretty broken (see #3148, #3188)
* wip for #3148Mike Bayer2014-09-064-9/+44
|
* - document all the varities of _label on the base ColumnElementMike Bayer2014-09-062-12/+56
| | | | | - replace out _columns_clause_label with a straight boolean flag to reduce the proliferation of labels
* - tiny refactors #1-#5Mike Bayer2014-09-051-3/+12
|
* - ensure literal_binds works with LIMIT clause, FOR UPDATEMike Bayer2014-09-031-6/+6
|
* - add logic to compiler such that if stack is empty, we justMike Bayer2014-09-023-2/+13
| | | | | | | | | | | | | | | | stringify a _label_reference() as is. - add .key to _label_reference(), so that when _make_proxy() is called, we don't call str() on it anyway. - add a test to exercise Query's behavior of adding all the order_by expressions to the columns list of the select, assert that things work out when we have a _label_reference there, that it gets sucked into the columns list and spit out on the other side, it's referred to appropriately, etc. _label_reference() could theoretically be resolved at the point we iterate _raw_columns() but it's better to just let things work as they already do (except nicer, since we get "tablename.colname" instead of just "somename" in the columns list) so that we aren't adding a ton of overhead to _columns_plus_names in the common case.
* - The :func:`~.expression.column` and :func:`~.expression.table`Mike Bayer2014-09-016-41/+167
| | | | | | | | | | | | | | | | | | | | | 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
* - more updates to text docs, literal_column, column etc. in prepMike Bayer2014-09-011-9/+20
| | | | for ticket 2992.
* - A new style of warning can be emitted which will "filter" up toMike Bayer2014-08-312-6/+14
| | | | | | | | | N occurrences of a parameterized string. This allows parameterized warnings that can refer to their arguments to be delivered a fixed number of times until allowing Python warning filters to squelch them, and prevents memory from growing unbounded within Python's warning registries. fixes #3178
* - this is small optimization, currently it's the best we can doMike Bayer2014-08-281-1/+2
| | | | for #3175. fixes #3175 (for now)
* Fix copy-paste error in Delete docGunnlaugur Þór Briem2014-08-211-2/+2
|
* - fix linkMike Bayer2014-08-211-1/+1
|
* - The INSERT...FROM SELECT construct now implies ``inline=True``Mike Bayer2014-08-202-14/+24
| | | | | | | | | | | | | | | | | | | | | | | on :class:`.Insert`. This helps to fix a bug where an INSERT...FROM SELECT construct would inadvertently be compiled as "implicit returning" on supporting backends, which would cause breakage in the case of an INSERT that inserts zero rows (as implicit returning expects a row), as well as arbitrary return data in the case of an INSERT that inserts multiple rows (e.g. only the first row of many). A similar change is also applied to an INSERT..VALUES with multiple parameter sets; implicit RETURNING will no longer emit for this statement either. As both of these constructs deal with varible numbers of rows, the :attr:`.ResultProxy.inserted_primary_key` accessor does not apply. Previously, there was a documentation note that one may prefer ``inline=True`` with INSERT..FROM SELECT as some databases don't support returning and therefore can't do "implicit" returning, but there's no reason an INSERT...FROM SELECT needs implicit returning in any case. Regular explicit :meth:`.Insert.returning` should be used to return variable numbers of result rows if inserted data is needed. fixes #3169
* - don't add the parent attach event within _on_table_attachMike Bayer2014-08-151-1/+2
| | | | | if we already have a table; this prevents reentrant calls and we aren't supporting columns/etc being moved around between different parents
* - The ``info`` parameter has been added to the constructor forMike Bayer2014-08-131-7/+47
| | | | | | | | | | | :class:`.SynonymProperty` and :class:`.ComparableProperty`. - The ``info`` parameter has been added as a constructor argument to all schema constructs including :class:`.MetaData`, :class:`.Index`, :class:`.ForeignKey`, :class:`.ForeignKeyConstraint`, :class:`.UniqueConstraint`, :class:`.PrimaryKeyConstraint`, :class:`.CheckConstraint`. fixes #2963
* - rework documentation for reflection flags; also includeMike Bayer2014-08-091-42/+99
| | | | information regarding #3027.
* Providing an autoload_with info automatically sets autoload to TrueMalik Diarra2014-08-091-2/+2
|
* - Fixed bug in CTE where ``literal_binds`` compiler argument would notMike Bayer2014-08-021-1/+1
| | | | | | be always be correctly propagated when one CTE referred to another aliased CTE in a statement. Fixes #3154
* - Fixed 0.9.7 regression caused by :ticket:`3067` in conjunction withMike Bayer2014-07-291-0/+3
| | | | | | a mis-named unit test such that so-called "schema" types like :class:`.Boolean` and :class:`.Enum` could no longer be pickled. fixes #3144
* - Added a supported :meth:`.FunctionElement.alias` method to functions,Mike Bayer2014-07-242-6/+50
| | | | | | | | | e.g. the ``func`` construct. Previously, behavior for this method was undefined. The current behavior mimics that of pre-0.9.4, which is that the function is turned into a single-column FROM clause with the given alias name, where the column itself is anonymously named. fixes #3137
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-2018-1807/+1988
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - Fixed a SQLite join rewriting issue where a subquery that is embeddedMike Bayer2014-07-153-8/+12
| | | | | | | | as a scalar subquery such as within an IN would receive inappropriate substitutions from the enclosing query, if the same table were present inside the subquery as were in the enclosing query such as in a joined inheritance scenario. fixes #3130
* - wrestle with conv() and tests some moreMike Bayer2014-07-142-42/+53
|