summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
...
* - [feature] The Core oeprator system now includesMike Bayer2012-08-203-20/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the `getitem` operator, i.e. the bracket operator in Python. This is used at first to provide index and slice behavior to the Postgresql ARRAY type, and also provides a hook for end-user definition of custom __getitem__ schemes which can be applied at the type level as well as within ORM-level custom operator schemes. Note that this change has the effect that descriptor-based __getitem__ schemes used by the ORM in conjunction with synonym() or other "descriptor-wrapped" schemes will need to start using a custom comparator in order to maintain this behavior. - [feature] postgresql.ARRAY now supports indexing and slicing. The Python [] operator is available on all SQL expressions that are of type ARRAY; integer or simple slices can be passed. The slices can also be used on the assignment side in the SET clause of an UPDATE statement by passing them into Update.values(); see the docs for examples. - [feature] Added new "array literal" construct postgresql.array(). Basically a "tuple" that renders as ARRAY[1,2,3].
* - [feature] The prefix_with() method is now availableMike Bayer2012-08-192-82/+86
| | | | | | | | on each of select(), insert(), update(), delete(), all with the same API, accepting multiple prefix calls, as well as a "dialect name" so that the prefix can be limited to one kind of dialect. [ticket:2431]
* tighten this upMike Bayer2012-08-181-8/+8
|
* - aaaaand fix one more glitch I just thought ofMike Bayer2012-08-181-0/+1
|
* - fix the labeled column with column_expression() issue, finishes [ticket:1534]Mike Bayer2012-08-183-14/+32
| | | | | | | | | | | - epic documentation sweep for new operator system, making ORM links consistent and complete, full documentation and examples for type/SQL expression feature - type_coerce() explicitly accepts BindParamClause objects - change UserDefinedType to coerce the other side to itself by default as this is much more likely what's desired - make coerce_compared_type() fully public on all types - have profiling run the test no matter what so that the test_zoomarks don't fail when callcounts are missing
* - [feature] To complement [ticket:2547], typesMike Bayer2012-08-171-48/+88
| | | | | | | | | | | | | | | | can now provide "bind expressions" and "column expressions" which allow compile-time injection of SQL expressions into statements on a per-column or per-bind level. This is to suit the use case of a type which needs to augment bind- and result- behavior at the SQL level, as opposed to in the Python level. Allows for schemes like transparent encryption/ decryption, usage of Postgis functions, etc. [ticket:1534] - update postgis example fully. - still need to repair the result map propagation here to be transparent for cases like "labeled column".
* _adapt_expression() moves fully to _DefaultColumnComparator which resumesMike Bayer2012-08-161-24/+57
| | | | | | its original role as stateful, forms the basis of TypeEngine.Comparator. lots of code goes back mostly as it was just with cleaner typing behavior, such as simple flow in _binary_operate now.
* -we move all the invocation of "_adapt_expression" into ↵Mike Bayer2012-08-161-59/+47
| | | | | | TypeEngine.Comparator. at this point the split of operator stuff is getting awkward and we might want to move _DefaultComparator.
* - we're going to attempt to get the type/operator system to eat its own ↵Mike Bayer2012-08-162-27/+27
| | | | | | | | dogfood and use the type-based comparator in all cases. will attempt to remove the _adapt_expression() method entirely as this represents an incomplete and redundant system (though it might be a lot faster)
* docs for custom ops...Mike Bayer2012-08-161-0/+17
|
* - [bug] Declarative can now propagate a columnMike Bayer2012-08-151-2/+88
| | | | | | | | declared on a single-table inheritance subclass up to the parent class' table, when the parent class is itself mapped to a join() or select() statement, directly or via joined inheritane, and not just a Table. [ticket:2549]
* - for the moment, the default comparisons don't need the ColumnOperator ↵Mike Bayer2012-08-141-15/+9
| | | | | | interface. Still a little concerned about the "self.expr" vs. "expr passed in" thing.
* - fix concat() operator, testsMike Bayer2012-08-142-29/+66
| | | | | | | | - [feature] Custom unary operators can now be used by combining operators.custom_op() with UnaryExpression(). - clean up the operator dispatch system and make it more consistent. This does change the compiler contract for custom ops.
* - hashableMike Bayer2012-08-131-0/+3
|
* - all tests passMike Bayer2012-08-131-28/+30
|
* move the whole thing to TypeEngine. the feature is pretty much for free ↵Mike Bayer2012-08-131-41/+13
| | | | like this.
* - develop new system of applying custom operators to ColumnElement classes. ↵Mike Bayer2012-08-132-131/+168
| | | | | | resembles that of the ORM so far.
* - allow compatibility with string ops passed here from custom librariesMike Bayer2012-08-131-0/+4
|
* 2.5 ismMike Bayer2012-07-281-2/+2
|
* - [feature] Added reduce_columns() methodMike Bayer2012-07-282-62/+45
| | | | | | | | | | | | | | | to select() construct, replaces columns inline using the util.reduce_columns utility function to remove equivalent columns. reduce_columns() also adds "with_only_synonyms" to limit the reduction just to those columns which have the same name. The deprecated fold_equivalents() feature is removed [ticket:1729]. - [feature] Added with_labels and reduce_columns keyword arguments to Query.subquery(), to provide two alternate strategies for producing queries with uniquely- named columns. [ticket:1729].
* -whitespace bonanza, contdMike Bayer2012-07-282-19/+19
|
* - we probably need to keep the __clause_element__() logic in, else we haveMike Bayer2012-07-241-35/+37
| | | | | a serious callcount problem. keeping the inspect() usage for those cases where we want to interpret ORM-level FROM objects only.
* - rework some more __clause_element__ methods to use inspection, but theres ↵Mike Bayer2012-07-231-57/+68
| | | | a ton more of these
* - some more interpret_as_fromsMike Bayer2012-07-231-3/+3
|
* - [feature] ORM entities can be passedMike Bayer2012-07-231-11/+43
| | | | | | | to select() as well as the select_from(), correlate(), and correlate_except() methods, where they will be unwrapped into selectables. [ticket:2245]
* some doc fixesMike Bayer2012-07-221-6/+7
|
* - [feature] Revised the rules used to determineMike Bayer2012-07-223-132/+154
| | | | | | | | | | | | 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-173-196/+253
| | | | | | 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-102-391/+427
| | | | | | | | | | | | | | | | 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.
* - [bug] ORM will perform extra effort to determineMike Bayer2012-07-051-58/+60
| | | | | | | | | that an FK dependency between two tables is not significant during flush if the tables are related via joined inheritance and the FK dependency is not part of the inherit_condition, saves the user a use_alter directive. [ticket:2527]
* add 2.5 compat for next()Mike Bayer2012-06-251-1/+1
|
* - move cte tests into their own test/sql/test_cte.pyMike Bayer2012-06-251-16/+36
| | | | | | | | | | - rework bindtemplate system of "numbered" params by applying the numbers last, as we now need to generate these out of order in some cases - add positional assertion to assert_compile - add new cte_positional collection to track bindparams generated within cte visits; splice this onto the beginning of self.positiontup at cte render time, [ticket:2521]
* absolute imports in core, sqlMike Bayer2012-06-237-19/+19
|
* - [bug] quoting is applied to the column namesMike Bayer2012-06-211-2/+5
| | | | | | | inside the WITH RECURSIVE clause of a common table expression according to the quoting rules for the originating Column. [ticket:2512]
* - [feature] Added "MATCH" clause to ForeignKey,Mike Bayer2012-06-211-22/+44
| | | | | | | | | | | | | | ForeignKeyConstraint, courtesy Ryan Kelly. [ticket:2502] - [feature] Added support for DELETE and UPDATE from an alias of a table, which would assumedly be related to itself elsewhere in the query, courtesy Ryan Kelly. [ticket:2507] - [feature] Added support for the Postgresql ONLY keyword, which can appear corresponding to a table in a SELECT, UPDATE, or DELETE statement. The phrase is established using with_hint(). Courtesy Ryan Kelly [ticket:2506]
* - [feature] Added "MATCH" clause to ForeignKey,Mike Bayer2012-06-211-0/+7
| | | | | ForeignKeyConstraint, courtesy Ryan Kelly. [ticket:2502]
* - [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.
* - [bug] Repaired common table expressionMike Bayer2012-06-131-6/+13
| | | | | | | rendering to function correctly when the SELECT statement contains UNION or other compound expressions, courtesy btbuilder. [ticket:2490]
* Add some `Sphinx` paragraph level versions informations markups,Mike Bayer2012-06-081-29/+32
| | | | such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
* ignore columns that don't resolve here either.Mike Bayer2012-05-191-1/+10
|
* - [bug] Quoting information is now passed alongMike Bayer2012-05-042-11/+24
| | | | | | | | 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] Fixed bug in relationship comparisonsMike Bayer2012-04-251-3/+3
| | | | | | | whereby calling unimplemented methods like SomeClass.somerelationship.like() would produce a recursion overflow, instead of NotImplementedError.
* - [feature] The "unconsumed column names" warning emittedMike Bayer2012-04-241-1/+1
| | | | | | when keys are present in insert.values() or update.values() that aren't in the target table is now an exception. [ticket:2415]
* - [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]