summaryrefslogtreecommitdiff
path: root/test/orm
Commit message (Collapse)AuthorAgeFilesLines
* Fixed bug where list instrumentation would fail to represent aMike Bayer2013-08-201-3/+8
| | | | | | | | setslice of ``[0:0]`` correctly, which in particular could occur when using ``insert(0, item)`` with the association proxy. Due to some quirk in Python collections, the issue was much more likely with Python 3 rather than 2. Also in 0.8.3, 0.7.11. [ticket:2807]
* more tests regarding expiry, deferralMike Bayer2013-08-171-1/+57
|
* some tests regarding how newly inserted rows are treated as far as fetch on ↵Mike Bayer2013-08-171-1/+91
| | | | access
* - spot checking of imports, obsolete functionsMike Bayer2013-08-171-4/+4
|
* Improved support for the cymysql driver, supporting version 0.6.5,Mike Bayer2013-08-171-1/+1
| | | | courtesy Hajime Nakagami.
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-142-8/+9
| | | | | | | | | - rework the event system so that event modules load after their targets, dependencies are reversed - create an improved strategy lookup system for the ORM - rework the ORM to have very few import cycles - move out "importlater" to just util.dependency - other tricks to cross-populate modules in as clear a way as possible
* - A large refactoring of the ``sqlalchemy.sql`` package has reorganizedMike Bayer2013-08-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | the import structure of many core modules. ``sqlalchemy.schema`` and ``sqlalchemy.types`` remain in the top-level package, but are now just lists of names that pull from within ``sqlalchemy.sql``. Their implementations are now broken out among ``sqlalchemy.sql.type_api``, ``sqlalchemy.sql.sqltypes``, ``sqlalchemy.sql.schema`` and ``sqlalchemy.sql.ddl``, the last of which was moved from ``sqlalchemy.engine``. ``sqlalchemy.sql.expression`` is also a namespace now which pulls implementations mostly from ``sqlalchemy.sql.elements``, ``sqlalchemy.sql.selectable``, and ``sqlalchemy.sql.dml``. Most of the "factory" functions used to create SQL expression objects have been moved to classmethods or constructors, which are exposed in ``sqlalchemy.sql.expression`` using a programmatic system. Care has been taken such that all the original import namespaces remain intact and there should be no impact on any existing applications. The rationale here was to break out these very large modules into smaller ones, provide more manageable lists of function names, to greatly reduce "import cycles" and clarify the up-front importing of names, and to remove the need for redundant functions and documentation throughout the expression package.
* - add predictable_gc to a few more tests showing up on pypyMike Bayer2013-08-042-6/+8
|
* - add a clear() to SetIsh here so that the control/direct gets clearedMike Bayer2013-08-021-10/+16
| | | | | before we do the pop() test. - make clear()/pop() test unconditional
* Added a new attribute :attr:`.Session.info` to :class:`.Session`;Mike Bayer2013-08-021-0/+17
| | | | | | | | this is a dictionary where applications can store arbitrary data local to a :class:`.Session`. The contents of :attr:`.Session.info` can be also be initialized using the ``info`` argument of :class:`.Session` or :class:`.sessionmaker`.
* - assorted fixes raised by pypy 2.1beta2, but all of which are goodMike Bayer2013-08-012-7/+11
| | | | | | | | | | | | | | | ideas in general: - pypy2.1 w/ sqlite3 is the first DBAPI we're seeing returning unicode in cursor.description without being py3k. add a new on-connect check for this, if we get back a u"", just don't do description decoding, should be OK for now. - the set tests in test_collection were assuming the two sets would be ordered the same when it tested pop(), can't really assume that. - test_serializer gets worse and worse, pickle is just not really viable here, ding out pypy - pypy2.1b2 seems to allow cursor.lastrowid to work (or we changed something?) - pool._threadconns.current() is a weakref, it can be None - another one of those logging.handlers imports
* - Removal of event listeners is now implemented. The feature isMike Bayer2013-07-261-11/+69
| | | | | | | | | | | | | | | | provided via the :func:`.event.remove` function. [ticket:2268] - reorganization of event.py module into a package; with the addition of the docstring work as well as the new registry for removal, there's a lot more code now. the package separates concerns and provides a top-level doc for each subsection of functionality - the remove feature works by providing the EventKey object which associates the user-provided arguments to listen() with a global, weak-referencing registry. This registry stores a collection of _ListenerCollection and _DispatchDescriptor objects associated with each set of arguments, as well as the wrapped function which was applied to that collection. The EventKey can then be recreated for a removal, all the _ListenerCollection and _DispatchDescriptor objects are located, and the correct wrapped function is removed from each one.
* - The mechanism by which attribute events pass along anMike Bayer2013-07-262-13/+6
| | | | | | | | | | | | | | | | | | | :class:`.AttributeImpl` as an "initiator" token has been changed; the object is now an event-specific object called :class:`.attributes.Event`. Additionally, the attribute system no longer halts events based on a matching "initiator" token; this logic has been moved to be specific to ORM backref event handlers, which are the typical source of the re-propagation of an attribute event onto subsequent append/set/remove operations. End user code which emulates the behavior of backrefs must now ensure that recursive event propagation schemes are halted, if the scheme does not use the backref handlers. Using this new system, backref handlers can now peform a "two-hop" operation when an object is appended to a collection, associated with a new many-to-one, de-associated with the previous many-to-one, and then removed from a previous collection. Before this change, the last step of removal from the previous collection would not occur. [ticket:2789]
* Fixed bug in ORM-level event registration where the "raw" orMike Bayer2013-07-181-13/+55
| | | | | | "propagate" flags could potentially be mis-configured in some "unmapped base class" configurations. Also in 0.8.3. [ticket:2786]
* A performance fix related to the usage of the :func:`.defer` optionMike Bayer2013-07-131-7/+16
| | | | | | | | | | | | | when loading mapped entities. The function overhead of applying a per-object deferred callable to an instance at load time was significantly higher than that of just loading the data from the row (note that ``defer()`` is meant to reduce DB/network overhead, not necessarily function call count); the function call overhead is now less than that of loading data from the column in all cases. There is also a reduction in the number of "lazy callable" objects created per load from N (total deferred values in the result) to 1 (total number of deferred cols). [ticket:2778]
* - create a new system where we can decorate an event methodMike Bayer2013-07-081-21/+72
| | | | | | | | | | | | | | | | with @_legacy_signature, will inspect incoming listener functions to see if they match an older signature, will wrap into a newer sig - add an event listen argument named=True, will send all args as kw args so that event listeners can be written with **kw, any combination of names - add a doc system to events that writes out the various calling styles for a given event, produces deprecation messages automatically. a little concerned that it's a bit verbose but will look at it up on RTD for awhile to get a feel. - change the calling signature for bulk update/delete events - we have the BulkUD object right there, and there's at least six or seven things people might want to see, so just send the whole BulkUD in [ticket:2775]
* - Added new method to the :func:`.insert` constructMike Bayer2013-07-051-1/+70
| | | | | | | | | | :meth:`.Insert.from_select`. Given a list of columns and a selectable, renders ``INSERT INTO (table) (columns) SELECT ..``. While this feature is highlighted as part of 0.9 it is also backported to 0.8.3. [ticket:722] - The :func:`.update`, :func:`.insert`, and :func:`.delete` constructs will now interpret ORM entities as FROM clauses to be operated upon, in the same way that select() already does. Also in 0.8.3.
* Fixed bug whereby attribute history functions would failMike Bayer2013-07-041-43/+128
| | | | | | | when an object we moved from "persistent" to "pending" using the :func:`.make_transient` function, for operations involving collection-based backrefs. [ticket:2773]
* - additional fix for [ticket:2750] where on an update, we make sure theMike Bayer2013-06-301-2/+33
| | | | value is present
* add better tests for [ticket:2750]Mike Bayer2013-06-301-3/+45
|
* A warning is emitted when trying to flush an object of an inheritedMike Bayer2013-06-301-3/+23
| | | | | mapped class where the polymorphic discriminator has been assigned to a value that is invalid for the class. [ticket:2750]
* - fix a regression caused by #2587, where query.join() would apply anMike Bayer2013-06-272-0/+89
| | | | | adapter to an aliased-mapped, non-polymorphic selectable that prevented us from referring directly to that selectable.
* - rework of correlation, continuing on #2668, #2746Mike Bayer2013-06-261-26/+68
| | | | | | | | | | | | | | | | | | | | | | | | - add support for correlations to propagate all the way in; because correlations require context now, need to make sure a select enclosure of any level takes effect any number of levels deep. - fix what we said correlate_except() was supposed to do when we first released #2668 - "the FROM clause is left intact if the correlated SELECT is not used in the context of an enclosing SELECT..." - it was not considering the "existing_froms" collection at all, and prohibited additional FROMs from being placed in an any() or has(). - add test for multilevel any() - lots of docs, including glossary entries as we really need to define "WHERE clause", "columns clause" etc. so that we can explain correlation better - based on the insight that a SELECT can correlate anything that ultimately came from an enclosing SELECT that links to this one via WHERE/columns/HAVING/ORDER BY, have the compiler keep track of the FROM lists that correspond in this way, link it to the asfrom flag, so that we send to _get_display_froms() the exact list of candidate FROMs to correlate. no longer need any asfrom logic in the Select() itself - preserve 0.8.1's behavior for correlation when no correlate options are given, not to mention 0.7 and prior's behavior of not propagating implicit correlation more than one level.. this is to reduce surprises/hard-to-debug situations when a user isn't trying to correlate anything.
* The resolution of :class:`.ForeignKey` objects to theirMike Bayer2013-06-231-1/+2
| | | | | | | | | | | | | | | | | | target :class:`.Column` has been reworked to be as immediate as possible, based on the moment that the target :class:`.Column` is associated with the same :class:`.MetaData` as this :class:`.ForeignKey`, rather than waiting for the first time a join is constructed, or similar. This along with other improvements allows earlier detection of some foreign key configuration issues. Also included here is a rework of the type-propagation system, so that it should be reliable now to set the type as ``None`` on any :class:`.Column` that refers to another via :class:`.ForeignKey` - the type will be copied from the target column as soon as that other column is associated, and now works for composite foreign keys as well. [ticket:1765]
* - rework PropComparator.adapted() to be PropComparator.adapt_to_entity(),Mike Bayer2013-06-171-1/+1
| | | | | | | passes in AliasedInsp and allows more flexibility. - rework the AliasedClass/AliasedInsp relationship so that AliasedInsp has all state and functionality. AliasedClass is just a facade. [ticket:2756]
* Fixed bug in polymorphic SQL generation where multiple joined-inheritanceMike Bayer2013-06-151-1/+91
| | | | | | | entities against the same base class joined to each other as well would not track columns on the base table independently of each other if the string of joins were more than two entities long. Also in 0.8.2. [ticket:2759]
* Fixed bug where sending a composite attribute into :meth:`.Query.order_by`Mike Bayer2013-06-101-1/+27
| | | | | would produce a parenthesized expression not accepted by some databases. [ticket:2754]
* Fixed the interaction between composite attributes andMike Bayer2013-06-101-4/+35
| | | | | | the :func:`.aliased` function. Previously, composite attributes wouldn't work correctly in comparison operations when aliasing was applied. Also in 0.8.2. [ticket:2755]
* - Fixed an obscure bug where the wrong results would beMike Bayer2013-06-074-95/+353
| | | | | | | | | | | fetched when joining/joinedloading across a many-to-many relationship to a single-table-inheriting subclass with a specific discriminator value, due to "secondary" rows that would come back. The "secondary" and right-side tables are now inner joined inside of parenthesis for all ORM joins on many-to-many relationships so that the left->right join can accurately filtered. [ticket:2369]
* remove all remaining start/end py2k/py3k blocksMike Bayer2013-06-073-71/+56
|
* dial back the default "flatness" a bit, it will be there for joinedload and ↵Mike Bayer2013-06-063-28/+154
| | | | | | | query.join(), but if you're dealing with aliased() or with_polymorphic() you need to say "flat=True". Just the one flag though, "flat" implies "aliased".
* a test for what's breaking, plus a non-working fix for it...Mike Bayer2013-06-051-1/+47
|
* Merge branch 'ticket_2587'Mike Bayer2013-06-047-207/+175
|\ | | | | | | | | | | Conflicts: test/profiles.txt test/sql/test_selectable.py
| * - improve overlapping selectables, apply to both query and relationshipMike Bayer2013-06-044-111/+81
| | | | | | | | | | | | - clean up inspect() calls within query._join() - make sure join.alias(flat) propagates - fix almost all assertion tests
| * - eager loadsMike Bayer2013-06-042-78/+52
| | | | | | | | - two suite of SQL assertions converted
| * working through tests....Mike Bayer2013-06-021-12/+11
| |
| * getting things to join without subqueries, but some glitches in the compiler ↵Mike Bayer2013-06-022-6/+31
| | | | | | | | | | | | step when we do query.count() are showing
* | Merge branch 'master' into ticket_1068Mike Bayer2013-06-0336-651/+685
|\ \ | |/
| * - blow away context._attributesMike Bayer2013-06-021-11/+4
| | | | | | | | | | - to account for query._attributes/context.attributes, just pass the attributes dict directly to the PathRegistry methods
| * Fixed a regression caused by [ticket:2682] whereby theMike Bayer2013-05-311-0/+17
| | | | | | | | | | | | | | evaluation invoked by :meth:`.Query.update` and :meth:`.Query.delete` would hit upon unsupported ``True`` and ``False`` symbols which now appear due to the usage of ``IS``. [ticket:2737]
| * add a test for the exception we want to raise hereMike Bayer2013-05-301-0/+12
| |
| * The "auto-aliasing" behavior of the :class:`.Query.select_from`Mike Bayer2013-05-302-45/+65
| | | | | | | | | | | | method has been turned off. The specific behavior is now availble via a new method :class:`.Query.select_entity_from`. [ticket:2736]
| * - add a test specific to sqlite testing cursor.description encoding (shouldMike Bayer2013-05-261-16/+10
| | | | | | | | | | probably be one in test_query or test_unicode...) - fix up test_unitofwork
| * merge defaultMike Bayer2013-05-131-0/+54
| |\
| * | py3k specific syntax moved into an execMike Bayer2013-05-041-25/+30
| | |
| * | cleanupMike Bayer2013-05-041-34/+62
| | |
| * | most of ORM passing...Mike Bayer2013-05-045-28/+12
| | |
| * | merge defaultMike Bayer2013-05-011-2/+3
| |\ \
| * \ \ merge defaultMike Bayer2013-04-301-1/+63
| |\ \ \
| * | | | - the raw 2to3 runMike Bayer2013-04-2735-586/+595
| | | | | | | | | | | | | | | | | | | | - went through examples/ and cleaned out excess list() calls