summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
* - start trying to move things into __slots__. This seems to reduce theslotsMike Bayer2015-01-044-59/+54
| | | | | size of the many per-column objects we're hitting, but somehow the overall memory is hardly being reduced at all in initial testing
* - test failures:Mike Bayer2015-01-021-1/+1
| | | | | - test_schema_2 is only on PG and doesn't need a drop all, omit this for now - py3k has exception.args[0], not message
* - restate sort_tables in terms of a more fine grainedMike Bayer2015-01-013-59/+296
| | | | | | | | | | | | | sort_tables_and_constraints function. - The DDL generation system of :meth:`.MetaData.create_all` and :meth:`.Metadata.drop_all` has been enhanced to in most cases automatically handle the case of mutually dependent foreign key constraints; the need for the :paramref:`.ForeignKeyConstraint.use_alter` flag is greatly reduced. The system also works for constraints which aren't given a name up front; only in the case of DROP is a name required for at least one of the constraints involved in the cycle. fixes #3282
* - Added a new accessor :attr:`.Table.foreign_key_constraints`Mike Bayer2015-01-011-0/+27
| | | | | to complement the :attr:`.Table.foreign_keys` collection, as well as :attr:`.ForeignKeyConstraint.referred_table`.
* correctionsMike Bayer2014-12-272-2/+2
|
* - correctionsMike Bayer2014-12-273-2/+10
| | | | - attempt to add a script to semi-automate the fixing of links
* - typo fixes #3269Mike Bayer2014-12-271-1/+1
|
* Maul the evaulate & friends typoPriit Laes2014-12-193-3/+3
|
* - Fixed bug where using a :class:`.TypeDecorator` that implementedMike Bayer2014-12-191-3/+7
| | | | | | | a type that was also a :class:`.TypeDecorator` would fail with Python's "Cannot create a consistent method resolution order (MRO)" error, when any kind of SQL comparison expression were used against an object using this type.
* - SQL Server 2012 now recommends VARCHAR(max), NVARCHAR(max),Mike Bayer2014-12-061-1/+1
| | | | | | | VARBINARY(max) for large text/binary types. The MSSQL dialect will now respect this based on version detection, as well as the new ``deprecate_large_types`` flag. fixes #3039
* - Added support for CTEs under Oracle. This includes some tweaksMike Bayer2014-12-042-45/+103
| | | | | | | to the aliasing syntax, as well as a new CTE feature :meth:`.CTE.suffix_with`, which is useful for adding in special Oracle-specific directives to the CTE. fixes #3220
* - The :meth:`.Operators.match` operator is now handled such that theMike Bayer2014-12-046-9/+47
| | | | | | | | | | | | | | | | return type is not strictly assumed to be boolean; it now returns a :class:`.Boolean` subclass called :class:`.MatchType`. The type will still produce boolean behavior when used in Python expressions, however the dialect can override its behavior at result time. In the case of MySQL, while the MATCH operator is typically used in a boolean context within an expression, if one actually queries for the value of a match expression, a floating point value is returned; this value is not compatible with SQLAlchemy's C-based boolean processor, so MySQL's result-set behavior now follows that of the :class:`.Float` type. A new operator object ``notmatch_op`` is also added to better allow dialects to define the negation of a match operation. fixes #3263
* - Fixed bug in :meth:`.Table.tometadata` method where theMike Bayer2014-11-292-11/+15
| | | | | | | | :class:`.CheckConstraint` associated with a :class:`.Boolean` or :class:`.Enum` type object would be doubled in the target table. The copy process now tracks the production of this constraint object as local to a type object. fixes #3260
* - use self.parent, not table here as there's an attributeerrorMike Bayer2014-11-251-1/+1
| | | | trap for self.table that behaves differently in py3k
* - The behavioral contract of the :attr:`.ForeignKeyConstraint.columns`Mike Bayer2014-11-252-43/+63
| | | | | | | | collection has been made consistent; this attribute is now a :class:`.ColumnCollection` like that of all other constraints and is initialized at the point when the constraint is associated with a :class:`.Table`. fixes #3243
* - Fixed issue where the columns from a SELECT embedded in anMike Bayer2014-11-111-0/+8
| | | | | | | | | INSERT, either through the values clause or as a "from select", would pollute the column types used in the result set produced by the RETURNING clause when columns from both statements shared the same name, leading to potential errors or mis-adaptation when retrieving the returning rows. fixes #3248
* - The :attr:`.Column.key` attribute is now used as the source ofMike Bayer2014-11-101-2/+2
| | | | | | | | | | | anonymous bound parameter names within expressions, to match the existing use of this value as the key when rendered in an INSERT or UPDATE statement. This allows :attr:`.Column.key` to be used as a "substitute" string to work around a difficult column name that doesn't translate well into a bound parameter name. Note that the paramstyle is configurable on :func:`.create_engine` in any case, and most DBAPIs today support a named and positional style. fixes #3245
* - Fixed bug regarding expression mutations which could expressMike Bayer2014-11-051-0/+7
| | | | | | | | itself as a "Could not locate column" error when using :class:`.Query` to select from multiple, anonymous column entities when querying against SQLite, as a side effect of the "join rewriting" feature used by the SQLite dialect. fixes #3241
* - 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
|