summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql_util.py
Commit message (Collapse)AuthorAgeFilesLines
* 1. Module layout. sql.py and related move into a package called "sql".Mike Bayer2007-08-181-249/+0
| | | | | | | | | | | | 2. compiler names changed to be less verbose, unused classes removed. 3. Methods on Dialect which return compilers, schema generators, identifier preparers have changed to direct class references, typically on the Dialect class itself or optionally as attributes on an individual Dialect instance if conditional behavior is needed. This takes away the need for Dialect subclasses to know how to instantiate these objects, and also reduces method overhead by one call for each one. 4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now). The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument. 5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py
* - draft sqlexpression tutorialMike Bayer2007-08-061-1/+9
| | | | | - added some generative methods to exists() - got clause adapter to work with join()
* merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to ↵Mike Bayer2007-07-271-9/+33
| | | | maintenance branch in branches/rel_0_3.
* - fixed max identifier length on postgres (63) [ticket:571]Gaëtan de Menten2007-07-171-1/+1
| | | | | - fixed doc typo ("in_" operator) - misc indent stuff
* - improved support for eagerloading of properties off of mappers that are mappedMike Bayer2007-05-221-2/+7
| | | | | | to select() statements; i.e. eagerloader is better at locating the correct selectable with which to attach its LEFT OUTER JOIN. - some fixes to new tests in inheritance5 to work with postgres
* - parenthesis are applied to clauses via a new _Grouping construct.Mike Bayer2007-05-141-5/+12
| | | | | | | | uses operator precedence to more intelligently apply parenthesis to clauses, provides cleaner nesting of clauses (doesnt mutate clauses placed in other clauses, i.e. no 'parens' flag) - added 'modifier' keyword, works like func.<foo> except does not add parenthesis. e.g. select([modifier.DISTINCT(...)]) etc.
* - Aliasizer removed. hooray !Mike Bayer2007-05-021-25/+2
| | | | - ClauseVisitor has handy chain() method.
* - for hackers, refactored the "visitor" system of ClauseElement andMike Bayer2007-03-111-7/+7
| | | | | | | | | | | | | | | SchemaItem so that the traversal of items is controlled by the ClauseVisitor itself, using the method visitor.traverse(item). accept_visitor() methods can still be called directly but will not do any traversal of child items. ClauseElement/SchemaItem now have a configurable get_children() method to return the collection of child elements for each parent object. This allows the full traversal of items to be clear and unambiguous (as well as loggable), with an easy method of limiting a traversal (just pass flags which are picked up by appropriate get_children() methods). [ticket:501] - accept_schema_visitor() methods removed, replaced with get_children(schema_visitor=True) - various docstring/changelog cleanup/reformatting
* - added concept of 'require_embedded' to corresponding_column.Mike Bayer2007-03-051-3/+3
| | | | | | | | | | | | requires that the target column be present in a sub-element of the target selectable. - embedded logic above more appropriate for ClauseAdapter functionality since its trying to "pull up" clauses that represent columns within a larger union up to the level of the union itself. - the "direction" test against the "foreign_keys" collection apparently works for an exact "column 'x' is present in the collection", no proxy relationships needed. fixes the case of relating a selectable/alias to one of its underlying tables, probably fixes other scenarios
* - added "fold_equivalents" argument to Join.select(), which removesMike Bayer2007-03-021-1/+4
| | | | | | | | | | | | 'duplicate' columns from the resulting column clause that are known to be equivalent based on the join condition. this is of great usage when constructing subqueries of joins which Postgres complains about if duplicate column names are present. - added support to polymorphic stuff for more than one "equivalent column", when trying to target columns in the polymorphic union; this applies to multi-leveled inheritance - put above-two concepts together to get the abc_inheritance tests to work with postgres
* migrated (most) docstrings to pep-257 format, docstring generator using ↵Mike Bayer2007-02-251-41/+72
| | | | | | straight <pre> + trim() func for now. applies most of [ticket:214], compliemnts of Lele Gaifax
* - improved support for complex queries embedded into "where" criterionMike Bayer2007-02-011-33/+56
| | | | | | | | | | | | | | for query.select() [ticket:449] - contains_eager('foo') automatically implies eagerload('foo') - query.options() can take a combiantion MapperOptions and tuples of MapperOptions, so that functions can return groups - refactoring to Aliasizer and ClauseAdapter so that they share a common base methodology, which addresses all sql.ColumnElements instead of just schema.Column. common list-processing methods added. - query.compile and eagerloader._aliasize_orderby make usage of improved list processing on above. - query.compile, within the "nested select generate" step processes the order_by clause using the ClauseAdapter instead of Aliasizer since there is only one "target"
* merged the polymorphic relationship refactoring branch in. i want to go ↵Mike Bayer2007-01-281-9/+23
| | | | | | | | | | | | | further on that branch and introduce the foreign_keys argument, and further centralize the "intelligence" about the joins and selectables into PropertyLoader so that lazyloader/sync can be simplified, but the current branch goes pretty far. - relations keep track of "polymorphic_primaryjoin", "polymorphic_secondaryjoin" which it derives from the plain primaryjoin/secondaryjoin. - lazy/eagerloaders work from those polymorphic join objects. - the join exported by PropertyLoader to Query/SelectResults is the polymorphic join, so that join_to/etc work properly. - Query builds itself against the base Mapper again, not the "polymorphic" mapper. uses the "polymorphic" version only as appropriate. this helps join_by/join_to/etc to work with polymorphic mappers. - Query will also adapt incoming WHERE criterion to the polymorphic mapper, i.e. the "people" table becomes the "person_join" automatically. - quoting has been modified since labels made out of non-case-sensitive columns could themselves require quoting..so case_sensitive defaults to True if not otherwise specified (used to be based on the identifier itself). - the test harness gets an ORMTest base class and a bunch of the ORM unit tests are using it now, decreases a lot of redundancy.
* - calling corresponding_column with keys_ok matches columns on name, not ↵Mike Bayer2007-01-241-2/+2
| | | | | | | | | | | | | | | | key, since the name is meaningful with regards to SQL relationships, the key is not - adjustments to the recent polymorphic relationship refactorings, specifically for many-to-one relationships to polymorphic unions that did not contain the base table [ticket:439]. the lazy/eager clause adaption to the selectable will match up on straight column names (i.e. its a more liberal policy) - lazy loader will not attempt to adapt the clause to the selectable if loads_polymorphic is not enabled, since the more liberal policy of adapting columns fails for more elaborate join conditions - will have to see if ppl want to do complex joins with polymorphic relations... may have to add "polymorphic_primaryjoin" in that case as a last resort (would make working around these issues a snap, tho...)
* relationships no longer compile against the "selectable" mapper (i.e. the ↵Mike Bayer2007-01-231-0/+48
| | | | polymorphic mapper). join conditions, foreign keys etc. are configured against the actual mappers used in the relationship in all cases. the lazy and eager loaders in turn "adapt" their lazy/eager clauses to that of the "selectable" mapper if one is present. this is because the join conditions between the mapper's base tables are *far* easier to work with and detect direction etc. compared to an enormous polymorphic union; dealing with the polymorphic union is pushed further out into select query construction.
* progress on [ticket:329]Mike Bayer2006-10-191-5/+2
|
* - ForeignKey(Constraint) supports "use_alter=True", to create/drop a foreign keyMike Bayer2006-10-151-0/+2
| | | | via ALTER. this allows circular foreign key relationships to be set up.
* - mapper.save_obj() now functions across all mappers in its polymorphicMike Bayer2006-10-081-15/+16
| | | | | | | series, UOWTask calls mapper appropriately in this manner - polymorphic mappers (i.e. using inheritance) now produces INSERT statements in order of tables across all inherited classes [ticket:321]
* more development on using eager loads/limit/offset/join_via/order_by at the ↵Mike Bayer2006-06-191-0/+37
| | | | same time
* "foreignkey" property of PropertyLoader is a sets.Set. removed "foreigntable".Mike Bayer2006-06-051-1/+0
| | | | simplified/fixed foreign key location in _find_dependent(), fixes [ticket:151]
* cleanupMike Bayer2006-06-021-1/+1
|
* - got rudimental "mapping to multiple tables" functionality cleaned up,Mike Bayer2006-06-021-3/+16
| | | | more correctly documented
* connection more careful about checking if its closed before operationsMike Bayer2006-05-291-1/+2
| | | | | small fix to table sort if no tables unit test tweaks
* merged 0.2 branch into trunk; 0.1 now in sqlalchemy/branches/rel_0_1Mike Bayer2006-05-251-0/+59