summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/session.py
Commit message (Collapse)AuthorAgeFilesLines
* wip3296Mike Bayer2015-02-041-8/+29
|
* - correctionsMike Bayer2014-12-271-2/+2
| | | | - attempt to add a script to semi-automate the fixing of links
* - 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
* - 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-071-11/+21
|
* - fix inheritance persistenceMike Bayer2014-12-071-0/+158
| | | | - start writing docs
* - initial tests for bulkMike Bayer2014-12-071-1/+2
|
* Merge branch 'master' into ticket_3100Mike Bayer2014-11-061-47/+61
|\
| * - Fixed bug where :meth:`.Session.expunge` would not fully detachMike Bayer2014-10-191-4/+8
| | | | | | | | | | | | | | the given object if the object had been subject to a delete operation that was flushed, but not committed. This would also affect related operations like :func:`.make_transient`. fixes #3139
| * - Improvements to the mechanism used by :class:`.Session` to locateMike Bayer2014-10-141-43/+53
| | | | | | | | | | | | | | "binds" (e.g. engines to use), such engines can be associated with mixin classes, concrete subclasses, as well as a wider variety of table metadata such as joined inheritance tables. fixes #3035
* | - add options to get back pk defaults for inserts.Mike Bayer2014-09-021-7/+9
| | | | | | | | times spent start getting barely different...
* | Merge branch 'master' into ticket_3100Mike Bayer2014-09-021-5/+5
|\ \ | |/
| * - need to use safe_discard() at least in _restore_snapshot(), let's use itMike Bayer2014-08-291-3/+3
| | | | | | | | everywhere in Session since the optimized one only applies to loading
| * - use a faster discard when loadingMike Bayer2014-08-291-2/+2
| | | | | | | | - don't do a bool on identity map since it calls __len__
* | - refinementsMike Bayer2014-08-191-19/+10
| |
* | - change to be represented as two very fast bulk_insert() and bulk_update() ↵Mike Bayer2014-08-151-28/+29
| | | | | | | | methods
* | devMike Bayer2014-08-151-6/+17
| |
* | - proof of conceptMike Bayer2014-08-151-0/+34
|/
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-159/+164
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - Fixed bug where items that were persisted, deleted, or had aMike Bayer2014-07-011-1/+4
| | | | | | | primary key change within a savepoint block would not participate in being restored to their former state (not in session, in session, previous PK) after the outer transaction were rolled back. fixes #3108
* - Adjustment to attribute mechanics concerning when a value isMike Bayer2014-05-291-25/+25
| | | | | | | | | | | | | | implicitly initialized to None via first access; this action, which has always resulted in a population of the attribute, now emits an attribute event just like any other attribute set operation and generates the same kind of history as one. Additionally, many mapper internal operations will no longer implicitly generate these "None" values when various never-set attributes are checked. These are subtle behavioral fixes to attribute mechanics which provide a better solution to the problem of :ticket:`3060`, which also involves recognition of attributes explicitly set to ``None`` vs. attributes that were never set. fixes #3061
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-2/+2
| | | | Found using: https://github.com/intgr/topy
* Added some links in session docsbenselme2014-04-231-35/+39
|
* - Added new utility function :func:`.make_transient_to_detached` which canMike Bayer2014-04-091-1/+35
| | | | | | | be used to manufacture objects that behave as though they were loaded from a session, then detached. Attributes that aren't present are marked as expired, and the object can be added to a Session where it will act like a persistent one. fix #3017
* -rewrite expire/refresh sectionMike Bayer2014-02-231-0/+24
|
* - happy new yearMike Bayer2014-01-051-1/+1
|
* Don't barf on Session(info=...) from sessionmaker(info=None)Robin Schoonover2013-12-311-1/+2
|
* load_on_pending is different from enable_relationship_loading and shouldMike Bayer2013-12-151-2/+8
| | | | not be superseded. both have a potential use.
* - The :class:`.exc.StatementError` or DBAPI-related subclassMike Bayer2013-12-111-1/+12
| | | | | | | | | | now can accomodate additional information about the "reason" for the exception; the :class:`.Session` now adds some detail to it when the exception occurs within an autoflush. This approach is taken as opposed to combining :class:`.FlushError` with a Python 3 style "chained exception" approach so as to maintain compatibility both with Py2K code as well as code that already catches ``IntegrityError`` or similar.
* - documentation cleanup in ORM including [ticket:2816]Mike Bayer2013-12-071-2/+3
|
* Merge pull request #45 from timka/patch-1mike bayer2013-11-291-1/+1
|\ | | | | Fix sessionmaker.__repr__
| * Fix sessionmaker.__repr__pr/45Timur2013-11-161-1/+1
| | | | | | A comma separating 'class_' from the other args. It's still there even when kw is empty, which is syntactically correct.
* | Generate API and resolve cross referencesVraj Mohan2013-11-171-1/+1
|/
* - spot checking of imports, obsolete functionsMike Bayer2013-08-171-2/+1
|
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-31/+41
| | | | | | | | | - 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
* Added a new attribute :attr:`.Session.info` to :class:`.Session`;Mike Bayer2013-08-021-2/+42
| | | | | | | | 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`.
* a pass where we try to squash down as many list()/keys() combinationsMike Bayer2013-05-261-4/+4
| | | | as possible
* merge defaultMike Bayer2013-04-301-3/+4
|\
| * - Fixed a regression from 0.7 where the contextmanager featureMike Bayer2013-04-301-3/+4
| | | | | | | | | | | | | | of :meth:`.Session.begin_nested` would fail to correctly roll back the transaction when a flush error occurred, instead raising its own exception while leaving the session still pending a rollback. [ticket:2718]
* | - the raw 2to3 runMike Bayer2013-04-271-10/+10
|/ | | | - went through examples/ and cleaned out excess list() calls
* - dont do a boolean check on the mapped objectMike Bayer2013-04-201-1/+1
|
* Improved the behavior of instance management regardingMike Bayer2013-04-201-3/+5
| | | | | | | | | | | | | | the creation of strong references within the Session; an object will no longer have an internal reference cycle created if it's in the transient state or moves into the detached state - the strong ref is created only when the object is attached to a Session and is removed when the object is detached. This makes it somewhat safer for an object to have a `__del__()` method, even though this is not recommended, as relationships with backrefs produce cycles too. A warning has been added when a class with a `__del__()` method is mapped. [ticket:2708]
* python2.5 fixMike Bayer2013-04-181-1/+2
|
* Reworked internal exception raises that emitMike Bayer2013-04-181-6/+6
| | | | | | | | | a rollback() before re-raising, so that the stack trace is preserved from sys.exc_info() before entering the rollback. This so that the traceback is preserved when using coroutine frameworks which may have switched contexts before the rollback function returns. [ticket:2703]
* - add some more transaction states so that we deliver a more accurateMike Bayer2013-03-041-36/+44
| | | | | | | | message for [ticket:2662]; after_commit() is called within "committed" state, not prepared, and no SQL can be emitted for prepared or committed - consolidate state assertions in session transaction, use just one method - add more unit tests for these assertions
* - A clear error message is emitted if an event handlerMike Bayer2013-02-251-14/+19
| | | | | | | | | | attempts to emit SQL on a Session within the after_commit() handler, where there is not a viable transaction in progress. [ticket:2662] - rework how SessionTransaction maintains state, using symbols instead. - add lots of notes and cross-linking for session events. - add a link to :func:`.select()` within :meth:`.FromClause.select`.
* - Added new helper function :func:`.was_deleted`, returns TrueMike Bayer2013-02-201-0/+4
| | | | | | | | | if the given object was the subject of a :meth:`.Session.delete` operation. - An object that's deleted from a session will be de-associated with that session fully after the transaction is committed, that is the :func:`.object_session` function will return None. [ticket:2658]
* see also for session commit, rollbackMike Bayer2013-02-111-1/+10
|
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|