summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - [feature] Revised the rules used to determineMike Bayer2012-07-221-24/+17
| | | | | | | | | | | | the operator precedence for the user-defined operator, i.e. that granted using the ``op()`` method. Previously, the smallest precedence was applied in all cases, now the default precedence is zero, lower than all operators except "comma" (such as, used in the argument list of a ``func`` call) and "AS", and is also customizable via the "precedence" argument on the ``op()`` method. [ticket:2537]
* a lot of docsMike Bayer2012-07-181-12/+68
|
* - a big renaming of all the _Underscore classes to haveMike Bayer2012-07-171-182/+239
| | | | | | plain names. The old names are still defined for backwards compatibility. - _BindParamClause renamed to BindParameter
* - express most of the orm.util functions in terms of the inspection systemMike Bayer2012-07-161-1/+10
| | | | | | | | | | | | | | - modify inspection system: 1. raise a new exception for any case where the inspection context can't be returned. this supersedes the "not mapped" errors. 2. don't configure mappers on a mapper inspection. this allows the inspectors to be used during mapper config time. instead, the mapper configures on "with_polymorphic_selectable" now, which is needed for all queries - add a bunch of new "is_XYZ" attributes to inspectors - finish making the name change of "compile" -> "configure", for some reason this was only done partially
* - [bug] Fixed more un-intuitivenesses in CTEsMike Bayer2012-07-101-248/+253
| | | | | | | | | | | | | | | | which prevented referring to a CTE in a union of itself without it being aliased. CTEs now render uniquely on name, rendering the outermost CTE of a given name only - all other references are rendered just as the name. This even includes other CTE/SELECTs that refer to different versions of the same CTE object, such as a SELECT or a UNION ALL of that SELECT. We are somewhat loosening the usual link between object identity and lexical identity in this case. A true name conflict between two unrelated CTEs now raises an error.
* absolute imports in core, sqlMike Bayer2012-06-231-4/+4
|
* - [bug] Fixed regression introduced in 0.7.6Mike Bayer2012-06-211-68/+83
| | | | | | whereby the FROM list of a SELECT statement could be incorrect in certain "clone+replace" scenarios. [ticket:2518]
* - [feature] The of_type() construct on attributesMike Bayer2012-06-201-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | now accepts aliased() class constructs as well as with_polymorphic constructs, and works with query.join(), any(), has(), and also eager loaders subqueryload(), joinedload(), contains_eager() [ticket:2438] [ticket:1106] - a rewrite of the query path system to use an object based approach for more succinct usage. the system has been designed carefully to not add an excessive method overhead. - [feature] select() features a correlate_except() method, auto correlates all selectables except those passed. Is needed here for the updated any()/has() functionality. - remove some old cruft from LoaderStrategy, init(),debug_callable() - use a namedtuple for _extended_entity_info. This method should become standard within the orm internals - some tweaks to the memory profile tests, number of runs can be customized to work around pysqlite's very annoying behavior - try to simplify PropertyOption._get_paths(), rename to _process_paths(), returns a single list now. overall works more completely as was needed for of_type() functionality
* - [bug] Fixed bug whereby append_column()Mike Bayer2012-06-161-2/+2
| | | | | | | wouldn't function correctly on a cloned select() construct, courtesy Gunnlaugur Por Briem. [ticket:2482] Also in 0.7.8.
* Add some `Sphinx` paragraph level versions informations markups,Mike Bayer2012-06-081-29/+32
| | | | such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
* - [bug] Quoting information is now passed alongMike Bayer2012-05-041-8/+20
| | | | | | | | from a Column with quote=True when generating a same-named bound parameter to the bindparam() object, as is the case in generated INSERT and UPDATE statements, so that unknown reserved names can be fully supported. [ticket:2437]
* - [bug] column.label(None) now produces anMike Bayer2012-04-241-12/+0
| | | | | | anonymous label, instead of returning the column object itself, consistent with the behavior of label(column, None). [ticket:2168]
* - [bug] The names of the columns on theMike Bayer2012-04-241-17/+16
| | | | | | | | .c. attribute of a select().apply_labels() is now based on <tablename>_<colkey> instead of <tablename>_<colname>, for those columns that have a distinctly named .key. [ticket:2397]
* - merged #1401 branch from bitbucketMike Bayer2012-04-221-7/+28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - resolved some serious speed hits I missed, we need to ensure only deannotated columns are used in the local/remote collections and soforth so that hash lookups against mapped columns don't dig into __eq__() - fix some other parity mismatches regarding stuff from [ticket:2453], including finding another case where _deep_annotate() was doing the wrong thing, new tests. - [feature] Major rewrite of relationship() internals now allow join conditions which include columns pointing to themselves within composite foreign keys. A new API for very specialized primaryjoin conditions is added, allowing conditions based on SQL functions, CAST, etc. to be handled by placing the annotation functions remote() and foreign() inline within the expression when necessary. Previous recipes using the semi-private _local_remote_pairs approach can be upgraded to this new approach. [ticket:1401]
| * - figured out again why deannotate must clone()Mike Bayer2012-02-111-4/+9
| | | | | | | | | | - got everything working. just need to update error strings
| * - got m2m, local_remote_pairs, etc. workingMike Bayer2012-02-091-6/+18
| | | | | | | | | | | | | | | | - using new traversal that returns the product of both sides of a binary, starting to work with (a+b) == (c+d) types of joins. primaryjoins on functions working - annotations working, including reversing local/remote when doing backref
| * simplify remote annotation significantly, and alsoMike Bayer2012-02-081-0/+4
| | | | | | | | catch the actual remote columns more accurately.
| * initial annotations approach to join conditions. all tests pass, plus ↵Mike Bayer2012-02-061-1/+1
| | | | | | | | | | | | additional tests in #1401 pass. would now like to reorganize RelationshipProperty more around the annotations concept.
* | - reopened #2453, needed to put in the original patch as well to cover the caseMike Bayer2012-04-031-0/+9
| | | | | | | | of column_property() objs building off each other
* | - [feature] Added new for_update/with_lockmode()Mike Bayer2012-03-211-5/+12
| | | | | | | | | | | | | | | | | | | | options for Postgresql: for_update="read"/ with_lockmode("read"), for_update="read_nowait"/ with_lockmode("read_nowait"). These emit "FOR SHARE" and "FOR SHARE NOWAIT", respectively. Courtesy Diana Clarke [ticket:2445]
* | I'm pretty sure this should be entitiesDiana Clarke2012-03-181-1/+1
| |
* | typos in lib/sqlalchemy/sqlDiana Clarke2012-03-171-12/+12
| |
* | - [feature] Added support for MSSQL INSERT,Mike Bayer2012-03-131-1/+41
| | | | | | | | | | | | UPDATE, and DELETE table hints, using new with_hint() method on UpdateBase. [ticket:2430]
* | fix typos, SQL server also needs union allMike Bayer2012-03-031-2/+2
| |
* | - [feature] Added cte() method to Query,Mike Bayer2012-03-031-0/+160
| | | | | | | | | | | | | | | | | | | | | | | | invokes common table expression support from the Core (see below). [ticket:1859] - [feature] Added support for SQL standard common table expressions (CTE), allowing SELECT objects as the CTE source (DML not yet supported). This is invoked via the cte() method on any select() construct. [ticket:1859]
* | - expand the check to determine if a selectable column is embeddedMike Bayer2012-02-291-4/+18
|/ | | | | | | | | | in the corresponding selectable to take into account clones of the target column. fixes [ticket:2419] - have _make_proxy() copy out the _is_clone_of attribute on the new column so that even more corresponding_column() checks work as expected for cloned elements. - add a new test fixture so that mapped tests can be specified using declarative.
* - [bug] Added support for using the .keyMike Bayer2012-02-051-6/+23
| | | | | | | | | | | | of a Column as a string identifier in a result set row. The .key is currently listed as an "alternate" name for a column, and is superseded by the name of a column which has that key value as its regular name. For the next major release of SQLAlchemy we may reverse this precedence so that .key takes precedence, but this is not decided on yet. [ticket:2392]
* - [bug] A significant change to how labelingMike Bayer2012-02-051-20/+54
| | | | | | | | | | | | | | is applied to columns in SELECT statements allows "truncated" labels, that is label names that are generated in Python which exceed the maximum identifier length (note this is configurable via label_length on create_engine()), to be properly referenced when rendered inside of a subquery, as well as to be present in a result set row using their original in-Python names. [ticket:2396] - apply pep8 to test_labels
* - add a warning regarding tuple.in_(), [ticket:2395]Mike Bayer2012-02-041-0/+8
| | | | - cleanup of exc.DBAPIError docstrings
* - [bug] Fixed bug whereby a table-bound ColumnMike Bayer2012-01-221-0/+14
| | | | | | | | | | | object named "<a>_<b>" which matched a column labeled as "<tablename>_<colname>" could match inappropriately when targeting in a result set row. [ticket:2377] - requires that we change the tuple format in RowProxy. Makes an improvement to the cases tested against an unpickled RowProxy as well though doesn't solve the problem there entirely.
* - Fixed regression from 0.6 whereby ifMike Bayer2012-01-101-0/+15
| | | | | | | "load_on_pending" relationship() flag were used where a non-"get()" lazy clause needed to be emitted on a pending object, it would fail to load.
* happy new yearMike Bayer2012-01-041-1/+1
|
* fix a whole bunch of note:: / warning:: that were inline,Mike Bayer2011-12-251-4/+8
| | | | no longer compatible with docutils 0.8
* - [bug] Fixed bug whereby column_property() createdMike Bayer2011-12-031-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | against ORM-level column could be treated as a distinct entity when producing certain kinds of joined-inh joins. [ticket:2316] - [bug] related to [ticket:2316], made some adjustments to the change from [ticket:2261] regarding the "from" list on a select(). The _froms collection is no longer memoized, as this simplifies various use cases and removes the need for a "warning" if a column is attached to a table after it was already used in an expression - the select() construct will now always produce the correct expression. There's probably no real-world performance hit here; select() objects are almost always made ad-hoc, and systems that wish to optimize the re-use of a select() would be using the "compiled_cache" feature. A hit which would occur when calling select.bind has been reduced, but the vast majority of users shouldn't be using "bound metadata" anyway :).
* merge tipMike Bayer2011-11-221-1/+1
|\
| * typoMike Bayer2011-11-221-1/+1
| |
* | fixes to actually get tests to passMike Bayer2011-11-221-0/+14
| |
* | - commit the unit testsMike Bayer2011-11-221-41/+144
|/ | | | - lots of doc updates to all three of update/insert/delete
* - [bug] further tweak to the fix from [ticket:2261],Mike Bayer2011-11-191-16/+108
| | | | | | | | | | | | so that generative methods work a bit better off of cloned (this is almost a non-use case though). In particular this allows with_only_columns() to behave more consistently. Added additional documentation to with_only_columns() to clarify expected behavior, which changed as a result of [ticket:2261]. [ticket:2319] - document the crap out of with_only_columns, include caveats about the change, etc.
* improved docs on select_from() [ticket:2274]Mike Bayer2011-09-261-4/+13
|
* - Fixed bug whereby with_only_columns() method ofMike Bayer2011-09-211-5/+7
| | | | | Select would fail if a selectable were passed. [ticket:2270]. Also in 0.6.9.
* - Changed the update() method on association proxyMike Bayer2011-09-141-1/+1
| | | | | | | | dictionary to use a duck typing approach, i.e. checks for "keys", to discern between update({}) and update((a, b)). Previously, passing a dictionary that had tuples as keys would be misinterpreted as a sequence. [ticket:2275]
* - Behavioral improvement: emptyMike Bayer2011-09-091-0/+6
| | | | | | | conjunctions such as and_() and or_() will be flattened in the context of an enclosing conjunction, i.e. and_(x, or_()) will produce 'X' and not 'X AND ()'. [ticket:2257].
* - Fixed bug regarding calculation of "from" listMike Bayer2011-09-051-181/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for a select() element. The "from" calc is now delayed, so that if the construct uses a Column object that is not yet attached to a Table, but is later associated with a Table, it generates SQL using the table as a FROM. This change impacted fairly deeply the mechanics of how the FROM list as well as the "correlates" collection is calculated, as some "clause adaption" schemes (these are used very heavily in the ORM) were relying upon the fact that the "froms" collection would typically be cached before the adaption completed. The rework allows it such that the "froms" collection can be cleared and re-generated at any time. [ticket:2261] - RelationshipProperty.Comparator._criterion_exists() adds an "_orm_adapt" annotation to the correlates target, to work with the change in [ticket:2261]. It's not clear if the change to correlation+adaption mechanics will affect end user code yet. - FromClause now uses group_expirable_memoized_property for late-generated values like primary key, _columns, etc. The Select class adds some tokens to this object and has the nice effect that FromClause doesn't need to know about Select's names anymore. An additional change might be to have Select use a different group_expirable_memoized_property so that it's collection of attribute names are specific to Select though this isn't really necessary right now.
* document autocommit when using the compiler extension, update the ↵Mike Bayer2011-08-181-1/+14
| | | | "understanding autocommit" section
* some core cross linkageMike Bayer2011-08-071-12/+35
|
* - rewrite cloned_traverse() and replacement_traverse() to use a straightMike Bayer2011-07-241-54/+62
| | | | | | | | | | | | | | | | recursive descent with clone() + _copy_internals(). This is essentially what it was doing anyway with lots of unnecessary steps. Fix Alias() to honor the given clone() function which may have been the reason the traversal hadn't been fixed sooner. Alias._copy_internals() will specifically skip an alias of a Table as a more specific form of what it was doing before. This may need to be further improved such that ClauseAdapter or replacement_traverse() send it some specific hints what not to dig into; **kw has been added to all _copy_internals() to support this. replacement/clone traversal is at least clear now. - apply new no_replacement_traverse annotation to join created by _create_joins(), fixes [ticket:2195] - can replace orm.query "_halt_adapt" with "no_replacement_traverse"
* - The join condition produced by with_parentMike Bayer2011-07-061-0/+9
| | | | | | | | as well as when using a "dynamic" relationship against a parent will generate unique bindparams, rather than incorrectly repeating the same bindparam. [ticket:2207]. Also in 0.6.9.
* - Fixed subtle bug that caused SQL to blowMike Bayer2011-06-271-1/+1
| | | | | | | up if: column_property() against subquery + joinedload + LIMIT + order by the column property() occurred. [ticket:2188]. Also in 0.6.9
* - Fixed a subtle bug involving columnMike Bayer2011-06-271-1/+5
| | | | | correspondence in a selectable with the same column repeated. Affects [ticket:2188].