summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
* - [feature] The behavior of column targetingMike Bayer2012-04-241-4/+14
| | | | | | | | | | | | | | in result sets is now case sensitive by default. SQLAlchemy for many years would run a case-insensitive conversion on these values, probably to alleviate early case sensitivity issues with dialects like Oracle and Firebird. These issues have been more cleanly solved in more modern versions so the performance hit of calling lower() on identifiers is removed. The case insensitive comparisons can be re-enabled by setting "case_insensitive=False" on create_engine(). [ticket:2423]
* - [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-224-49/+167
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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]
| * start to work on error messages, allow foreign_keys as only argumentMike Bayer2012-02-251-3/+11
| | | | | | | | if otherwise can't determine join condition due to no fks
| * - figured out again why deannotate must clone()Mike Bayer2012-02-113-9/+14
| | | | | | | | | | - got everything working. just need to update error strings
| * many fixes but still can't get heuristics to work as well as what's existing,Mike Bayer2012-02-111-2/+1
| | | | | | | | tests still failing
| * tweak for correlated subqueries here, seems to work for ↵Mike Bayer2012-02-101-1/+6
| | | | | | | | test_eager_relations:CorrelatedSubqueryTest but need some more testing here
| * - got m2m, local_remote_pairs, etc. workingMike Bayer2012-02-092-12/+88
| | | | | | | | | | | | | | | | - 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-082-0/+9
| | | | | | | | catch the actual remote columns more accurately.
| * initial annotations approach to join conditions. all tests pass, plus ↵Mike Bayer2012-02-063-21/+35
| | | | | | | | | | | | additional tests in #1401 pass. would now like to reorganize RelationshipProperty more around the annotations concept.
* | - [bug] UPDATE..FROM syntax with SQL ServerMike Bayer2012-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | requires that the updated table be present in the FROM clause when an alias of that table is also present in the FROM clause. The updated table is now always present in the FROM, when FROM is present in the first place. Courtesy sayap. [ticket:2468]
* | - 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
* | - [bug] Fixed bug in expression annotationMike Bayer2012-03-311-9/+21
| | | | | | | | | | | | | | mechanics which could lead to incorrect rendering of SELECT statements with aliases and joins, particularly when using column_property(). [ticket:2453]
* | - [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-172-15/+15
| |
* | revert this, the instrumentation here is conditionalMike Bayer2012-03-131-2/+2
| |
* | add most of Brad Allen's doc updates, [ticket:2434]Mike Bayer2012-03-131-8/+28
|\ \
| * | Tiny wording fix in a commentBrad Allen2011-03-161-2/+2
| | |
| * | Slight sanity/clarity improvement to the way VisitableType binds theBrad Allen2011-03-161-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | _compiler_dispatch. This code change has no functional or performance implications, but it helps make the docstring easier to write. Mostly this commit is about docstring improvements and comments to explain optimizations.
* | | - [feature] Added support for MSSQL INSERT,Mike Bayer2012-03-132-6/+98
| | | | | | | | | | | | | | | | | | UPDATE, and DELETE table hints, using new with_hint() method on UpdateBase. [ticket:2430]
* | | - [bug] Fixed bug whereby a primaryjoinMike Bayer2012-03-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | condition with a "literal" in it would raise an error on compile with certain kinds of deeply nested expressions which also needed to render the same bound parameter name more than once. [ticket:2425]
* | | fix typos, SQL server also needs union allMike Bayer2012-03-031-2/+2
| | |
* | | - [feature] Added cte() method to Query,Mike Bayer2012-03-032-0/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | remove check_columns here so warning not emitted with update fromMike Bayer2012-02-261-1/+1
| | |
* | | - [bug] A warning is emitted when a not-presentMike Bayer2012-02-211-2/+12
| |/ |/| | | | | | | | | | | column is stated in the values() clause of an insert() or update() construct. Will move to an exception in 0.8. [ticket:2413]
* | - [bug] Added support for using the .keyMike Bayer2012-02-052-13/+42
| | | | | | | | | | | | | | | | | | | | | | | | 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-052-30/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | fix a few py3k bugsMike Bayer2012-01-281-0/+1
| |
* | - [feature] Dialect-specific compilers now raiseMike Bayer2012-01-281-13/+30
| | | | | | | | | | | | | | | | CompileException for all type/statement compilation issues, instead of InvalidRequestError or ArgumentError. The DDL for CREATE TABLE will re-raise CompileExceptions to include table/column information for the problematic column. [ticket:2361]
* | - [bug] Fixed issue where the "required" exceptionMike Bayer2012-01-281-11/+22
| | | | | | | | | | | | would not be raised for bindparam() with required=True, if the statement were given no parameters at all. [ticket:2381]
* | - [bug] Fixed bug whereby a table-bound ColumnMike Bayer2012-01-222-0/+18
| | | | | | | | | | | | | | | | | | | | | | 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.
* | - [feature] Added "false()" and "true()" expressionMike Bayer2012-01-181-0/+2
| | | | | | | | | | | | | | constructs to sqlalchemy.sql namespace, though not part of __all__ as of yet. - [bug] sql.false() and sql.true() compile to 0 and 1, respectively in sqlite [ticket:2368]
* | - Fixed regression from 0.6 whereby ifMike Bayer2012-01-103-14/+18
| | | | | | | | | | | | | | "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-047-7/+7
| |
* | fix a whole bunch of note:: / warning:: that were inline,Mike Bayer2011-12-251-4/+8
| | | | | | | | no longer compatible with docutils 0.8
* | - [bug] the "name" of a column-level CHECK constraint,Mike Bayer2011-12-041-1/+5
| | | | | | | | | | | | if present, is now rendered in the CREATE TABLE statement using "CONSTRAINT <name> CHECK <expression>". [ticket:2305]
* | - [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 :).
* | also add support for onupdate as we'd like this to fire off if an UPDATE ↵Mike Bayer2011-11-221-13/+31
| | | | | | | | | | | | actually happens on the table
* | merge tipMike Bayer2011-11-221-1/+1
|\ \
| * | typoMike Bayer2011-11-221-1/+1
| | |
* | | fixes to actually get tests to passMike Bayer2011-11-222-17/+26
| | |
* | | - commit the unit testsMike Bayer2011-11-221-41/+144
| | | | | | | | | | | | - lots of doc updates to all three of update/insert/delete
* | | cleanupMike Bayer2011-11-211-22/+42
| | |
* | | passes for all three, includes multi col system with mysqlMike Bayer2011-11-211-6/+32
| | |
* | | sort of muscling this out, mysql a PITAMike Bayer2011-11-211-7/+47
|/ /
* | - [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.