summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
Commit message (Collapse)AuthorAgeFilesLines
* Accept unicode in CascadeOptionspr/160Julien Castets2015-03-161-1/+1
|
* - fix a get call here, we should figure this out since we dont wantMike Bayer2015-03-121-1/+1
| | | | to be using getattr
* - Added a new extension suite :mod:`sqlalchemy.ext.baked`. ThisMike Bayer2015-03-116-128/+207
| | | | | | | | simple but unusual system allows for a dramatic savings in Python overhead for the construction and processing of orm :class:`.Query` objects, from query construction up through rendering of a string SQL statement. fixes #3054
* - Added a new entry ``"entity"`` to the dictionaries returned byMike Bayer2015-03-111-2/+8
| | | | | | | | | :attr:`.Query.column_descriptions`. This refers to the primary ORM mapped class or aliased class that is referred to by the expression. Compared to the existing entry for ``"type"``, it will always be a mapped entity, even if extracted from a column expression, or None if the given expression is a pure core expression. references #3320
* - Added a new event suite :class:`.QueryEvents`. TheMike Bayer2015-03-102-5/+63
| | | | | | | | | | | :meth:`.QueryEvents.before_compile` event allows the creation of functions which may place additional modifications to :class:`.Query` objects before the construction of the SELECT statement. It is hoped that this event be made much more useful via the advent of a new inspection system that will allow for detailed modifications to be made against :class:`.Query` objects in an automated fashion. fixes #3317
* - The subquery wrapping which occurs when joined eager loadingMike Bayer2015-03-101-1/+1
| | | | | | | | | is used with a one-to-many query that also features LIMIT, OFFSET, or DISTINCT has been disabled in the case of a one-to-one relationship, that is a one-to-many with :paramref:`.relationship.uselist` set to False. This will produce more efficient queries in these cases. fixes #3249
* - Fixed bug where the session attachment error "object is alreadyMike Bayer2015-03-101-7/+7
| | | | | | | attached to session X" would fail to prevent the object from also being attached to the new session, in the case that execution continued after the error raise occurred. fixes #3301
* - copyright 2015Mike Bayer2015-03-1029-29/+29
|
* - pick around gaining modest dings in callcounts here and thereMike Bayer2015-03-091-15/+17
|
* - random performance whacking vs. 0.9, in particular we have to watchMike Bayer2015-03-082-1/+7
| | | | for the slots-based __getattr__ thing getting hit
* minor docstring fix in MappedCollection classJochem Oosterveen2015-03-061-2/+2
|
* - squash-merge the final row_proc integration branch. this isMike Bayer2015-03-017-88/+152
| | | | | | | | | | | | | | | a much more modest outcome than what we started with. The work of create_row_processor() for ColumnProperty objects is essentially done at query setup time combined with some lookups in _instance_processor(). - to allow this change for deferred columns, deferred columns no longer search for themselves in the result. If they've been set up as deferred without any explicit directive to undefer them, then this is what was asked for. if we don't do this, then we're stuck with this performance penalty for all deferred columns which in the vast majority of typical use cases (e.g. loading large, legacy tables or tables with many/large very seldom used values) won't be present in the result and won't be accessed at all.
* - Fixed bugs in ORM object comparisons where comparison ofMike Bayer2015-02-201-3/+4
| | | | | | | | | | many-to-one ``!= None`` would fail if the source were an aliased class, or if the query needed to apply special aliasing to the expression due to aliased joins or polymorphic querying; also fixed bug in the case where comparing a many-to-one to an object state would fail if the query needed to apply special aliasing due to aliased joins or polymorphic querying. fixes #3310
* - remove the need for a recursive call hereMike Bayer2015-02-201-5/+12
|
* - Fixed bug where internal assertion would fail in the case whereMike Bayer2015-02-201-2/+5
| | | | | | | | an ``after_rollback()`` handler for a :class:`.Session` incorrectly adds state to that :class:`.Session` within the handler, and the task to warn and remove this state (established by :ticket:`2389`) attempts to proceed. fixes #3309
* - Mapped state internals have been reworked to allow for a 50% reductionMike Bayer2015-02-187-77/+149
| | | | | | | | in callcounts specific to the "expiration" of objects, as in the "auto expire" feature of :meth:`.Session.commit` and for :meth:`.Session.expire_all`, as well as in the "cleanup" step which occurs when object states are garbage collected. fixes #3307
* - remove meaningless assignmentMike Bayer2015-02-081-1/+0
|
* - test + changelogMike Bayer2015-02-081-2/+2
|
* Merge remote-tracking branch 'origin/pr/147' into pr147Mike Bayer2015-02-081-1/+1
|\ | | | | | | | | Conflicts: lib/sqlalchemy/orm/query.py
| * It's the 'kwargs' which are iterable, not 'keys'pr/147Malthe Borch2014-10-301-2/+1
| |
* | - A warning is emitted if the ``isolation_level`` parameter is usedMike Bayer2015-02-041-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with :meth:`.Connection.execution_options` when a :class:`.Transaction` is in play; DBAPIs and/or SQLAlchemy dialects such as psycopg2, MySQLdb may implicitly rollback or commit the transaction, or not change the setting til next transaction, so this is never safe. - Added new parameter :paramref:`.Session.connection.execution_options` which may be used to set up execution options on a :class:`.Connection` when it is first checked out, before the transaction has begun. This is used to set up options such as isolation level on the connection before the transaction starts. - added new documentation section detailing best practices for setting transaction isolation with sessions. fixes #3296
* | - Fixed bug in lazy loading SQL construction whereby a complexMike Bayer2015-02-021-14/+18
| | | | | | | | | | | | | | | | primaryjoin that referred to the same "local" column multiple times in the "column that points to itself" style of self-referential join would not be substituted in all cases. The logic to determine substitutions here has been reworked to be more open-ended. fixes #3300
* | - don't overwrite an existing _strategy_keys collection;Mike Bayer2015-02-021-1/+2
| | | | | | | | this would cause LazyLoader to be initialized twice per property.
* | Merge branch 'bb_issue_3262' of https://bitbucket.org/xflr6/sqlalchemyMike Bayer2015-01-261-0/+9
|\ \
| * | warn on duplicate polymorphic_identitySebastian Bank2014-12-041-0/+9
| | |
* | | - restore r611883ffb35ca6664649f6328ae8 with additional fixes and an ↵Mike Bayer2015-01-192-17/+38
| | | | | | | | | | | | | | | | | | additional test that is much more specific to #1326
* | | - reverse the last commit temporarily as it breaks all the polymorphic casesMike Bayer2015-01-192-42/+24
| | |
* | | - The primary :class:`.Mapper` of a :class:`.Query` is now passed to theMike Bayer2015-01-192-24/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :meth:`.Session.get_bind` method when calling upon :meth:`.Query.count`, :meth:`.Query.update`, :meth:`.Query.delete`, as well as queries against mapped columns, :obj:`.column_property` objects, and SQL functions and expressions derived from mapped columns. This allows sessions that rely upon either customized :meth:`.Session.get_bind` schemes or "bound" metadata to work in all relevant cases. fixes #3227 fixes #3242 fixes #1326
* | | - further fixes and even better tests for this blockMike Bayer2015-01-191-3/+8
| | |
* | | - another adjustmentMike Bayer2015-01-191-2/+3
| | |
* | | - fix another issue from rf49c367ef, add another testMike Bayer2015-01-181-1/+1
| | |
* | | - fix a regression from ref #3178, where dialects that don't actually supportMike Bayer2015-01-171-4/+12
| | | | | | | | | | | | | | | sane multi rowcount (e.g. pyodbc) would fail on multirow update. add a test that mocks this breakage into plain dialects
* | | - The "wildcard" loader options, in particular the one set up byMike Bayer2015-01-134-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the :func:`.orm.load_only` option to cover all attributes not explicitly mentioned, now takes into account the superclasses of a given entity, if that entity is mapped with inheritance mapping, so that attribute names within the superclasses are also omitted from the load. Additionally, the polymorphic discriminator column is unconditionally included in the list, just in the same way that primary key columns are, so that even with load_only() set up, polymorphic loading of subtypes continues to function correctly. fixes #3287
* | | - doc fixesMike Bayer2015-01-062-12/+14
| | |
* | | - Fixed bug where if an exception were thrown at the start of aMike Bayer2015-01-051-31/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :class:`.Query` before it fetched results, particularly when row processors can't be formed, the cursor would stay open with results pending and not actually be closed. This is typically only an issue on an interpreter like Pypy where the cursor isn't immediately GC'ed, and can in some circumstances lead to transactions/ locks being open longer than is desirable. fixes #3285
* | | - add MemoizedSlots, a generalized solution to using __getattr__Mike Bayer2015-01-057-19/+76
| | | | | | | | | | | | | | | for memoization on a class that uses slots. - apply many more __slots__. mem use for nova now at 46% savings
* | | - callcountsMike Bayer2015-01-041-2/+0
| | | | | | | | | | | | - this needs to be serializable and isn't high volume so just whack the slots
* | | - strategies + declarativeMike Bayer2015-01-042-0/+25
| | |
* | | - wip - start factoring events so that we aren't using descriptors for dispatch,Mike Bayer2015-01-042-3/+4
| | | | | | | | | | | | allowing us to move to __slots__
* | | - start trying to move things into __slots__. This seems to reduce theslotsMike Bayer2015-01-044-37/+68
| | | | | | | | | | | | | | | size of the many per-column objects we're hitting, but somehow the overall memory is hardly being reduced at all in initial testing
* | | - tighten the inspection in _ColumnEntity to reduce unnecessaryMike Bayer2015-01-031-14/+14
| | | | | | | | | | | | isinstance() calls, express intent more clearly
* | | - fix links for loading, add a redirect pageMike Bayer2014-12-272-3/+3
| | | | | | | | | | | | | | | | | | bump foo
* | | - correctionsMike Bayer2014-12-271-2/+2
| | | | | | | | | | | | - attempt to add a script to semi-automate the fixing of links
* | | Maul the evaulate & friends typoPriit Laes2014-12-191-2/+2
| | |
* | | - Added new method :meth:`.Session.invalidate`, functions similarlyMike Bayer2014-12-121-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to :meth:`.Session.close`, except also calls :meth:`.Connection.invalidate` on all connections, guaranteeing that they will not be returned to the connection pool. This is useful in situations e.g. dealing with gevent timeouts when it is not safe to use the connection further, even for rollbacks. references #3258
* | | - fix up query update /delete documentation, make warningsMike Bayer2014-12-101-69/+110
| | | | | | | | | | | | a lot clearer, partial fixes for #3252
* | | - A new series of :class:`.Session` methods which provide hooksMike Bayer2014-12-081-22/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directly into the unit of work's facility for emitting INSERT and UPDATE statements has been created. When used correctly, this expert-oriented system can allow ORM-mappings to be used to generate bulk insert and update statements batched into executemany groups, allowing the statements to proceed at speeds that rival direct use of the Core. fixes #3100
* | | - add an option for bulk_save -> update to not do historyMike Bayer2014-12-072-13/+28
| | |
* | | - fix inheritance persistenceMike Bayer2014-12-073-6/+184
| | | | | | | | | | | | - start writing docs
* | | - initial tests for bulkMike Bayer2014-12-071-1/+2
| | |