summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util
Commit message (Collapse)AuthorAgeFilesLines
* - remove context-specific post-crud logic from Connection and inline post-crudMike Bayer2015-01-251-2/+7
| | | | | | | | | | logic to some degree in DefaultExecutionContext. In particular we are removing post_insert() which doesn't appear to be used based on a survey of prominent third party dialects. Callcounts aren't added to existing execute profiling tests and inserts might be a little better. - simplify the execution_options join in DEC. Callcounts don't appear affected.
* - Custom dialects that implement :class:`.GenericTypeCompiler` canMike Bayer2015-01-162-1/+28
| | | | | | | | | | | | | | now be constructed such that the visit methods receive an indication of the owning expression object, if any. Any visit method that accepts keyword arguments (e.g. ``**kw``) will in most cases receive a keyword argument ``type_expression``, referring to the expression object that the type is contained within. For columns in DDL, the dialect's compiler class may need to alter its ``get_column_specification()`` method to support this as well. The ``UserDefinedType.get_col_spec()`` method will also receive ``type_expression`` if it provides ``**kw`` in its argument signature. fixes #3074
* - add MemoizedSlots, a generalized solution to using __getattr__Mike Bayer2015-01-053-4/+58
| | | | | for memoization on a class that uses slots. - apply many more __slots__. mem use for nova now at 46% savings
* - use a different bitwise approach here that doesn't require iteratingMike Bayer2015-01-032-1/+10
| | | | through all possible set values
* - The :class:`.mysql.SET` type has been overhauled to no longerMike Bayer2015-01-031-2/+2
| | | | | | | | | | | | | | assume that the empty string, or a set with a single empty string value, is in fact a set with a single empty string; instead, this is by default treated as the empty set. In order to handle persistence of a :class:`.mysql.SET` that actually wants to include the blank value ``''`` as a legitimate value, a new bitwise operational mode is added which is enabled by the :paramref:`.mysql.SET.retrieve_as_bitwise` flag, which will persist and retrieve values unambiguously using their bitflag positioning. Storage and retrieval of unicode values for driver configurations that aren't converting unicode natively is also repaired. fixes #3283
* Maul the evaulate & friends typoPriit Laes2014-12-191-1/+1
|
* - The :meth:`.PropComparator.of_type` modifier has beenMike Bayer2014-11-241-3/+6
| | | | | | | | | | | | | | | improved in conjunction with loader directives such as :func:`.joinedload` and :func:`.contains_eager` such that if two :meth:`.PropComparator.of_type` modifiers of the same base type/path are encountered, they will be joined together into a single "polymorphic" entity, rather than replacing the entity of type A with the one of type B. E.g. a joinedload of ``A.b.of_type(BSub1)->BSub1.c`` combined with joinedload of ``A.b.of_type(BSub2)->BSub2.c`` will create a single joinedload of ``A.b.of_type((BSub1, BSub2)) -> BSub1.c, BSub2.c``, without the need for the ``with_polymorphic`` to be explicit in the query. fixes #3256
* - The ``__module__`` attribute is now set for all those SQL andMike Bayer2014-10-141-1/+3
| | | | | | | ORM functions that are derived as "public factory" symbols, which should assist with documentation tools being able to report on the target module. fixes #3218
* Merge remote-tracking branch 'origin/pr/140' into pr140Mike Bayer2014-10-111-3/+3
|\
| * cleanup exception handling - use new exception hierarchy (since python 2.5)pr/140ndparker2014-10-021-9/+3
| |
| * improve exception vs. exit handlingndparker2014-09-231-0/+6
| |
* | - refactor of declarative, break up into indiviudal methodsMike Bayer2014-09-252-2/+16
|/ | | | | | | | | | | | | | | | | | | | | | | that are now affixed to _MapperConfig - declarative now creates column copies ahead of time so that they are ready to go for a declared_attr - overhaul of declared_attr; memoization, cascading modifier - A relationship set up with :class:`.declared_attr` on a :class:`.AbstractConcreteBase` base class will now be configured on the abstract base mapping automatically, in addition to being set up on descendant concrete classes as usual. fixes #2670 - The :class:`.declared_attr` construct has newly improved behaviors and features in conjunction with declarative. The decorated function will now have access to the final column copies present on the local mixin when invoked, and will also be invoked exactly once for each mapped class, the returned result being memoized. A new modifier :attr:`.declared_attr.cascading` is added as well. fixes #3150 - the original plan for #3150 has been scaled back; by copying mixin columns up front and memoizing, we don't actually need the "map properties later" thing. - full docs + migration notes
* - The :func:`~.expression.column` and :func:`~.expression.table`Mike Bayer2014-09-011-4/+4
| | | | | | | | | | | | | | | | | | | | | constructs are now importable from the "from sqlalchemy" namespace, just like every other Core construct. - The implicit conversion of strings to :func:`.text` constructs when passed to most builder methods of :func:`.select` as well as :class:`.Query` now emits a warning with just the plain string sent. The textual conversion still proceeds normally, however. The only method that accepts a string without a warning are the "label reference" methods like order_by(), group_by(); these functions will now at compile time attempt to resolve a single string argument to a column or label expression present in the selectable; if none is located, the expression still renders, but you get the warning again. The rationale here is that the implicit conversion from string to text is more unexpected than not these days, and it is better that the user send more direction to the Core / ORM when passing a raw string as to what direction should be taken. Core/ORM tutorials have been updated to go more in depth as to how text is handled. fixes #2992
* - A new style of warning can be emitted which will "filter" up toMike Bayer2014-08-313-12/+44
| | | | | | | | | N occurrences of a parameterized string. This allows parameterized warnings that can refer to their arguments to be delivered a fixed number of times until allowing Python warning filters to squelch them, and prevents memory from growing unbounded within Python's warning registries. fixes #3178
* - major refactoring/inlining to loader.instances(), though not reallyMike Bayer2014-08-282-1/+9
| | | | | | | | | | | any speed improvements :(. code is in a much better place to be run into C, however - The ``proc()`` callable passed to the ``create_row_processor()`` method of custom :class:`.Bundle` classes now accepts only a single "row" argument. - Deprecated event hooks removed: ``populate_instance``, ``create_instance``, ``translate_row``, ``append_result`` - the getter() idea is somewhat restored; see ref #3175
* - A new implementation for :class:`.KeyedTuple` used by theMike Bayer2014-08-282-16/+56
| | | | | | :class:`.Query` object offers dramatic speed improvements when fetching large numbers of column-oriented rows. fixes #3176
* - mutablemapping adds compiler overhead, so screw itMike Bayer2014-08-151-5/+9
|
* - TIL that dict.keys() in py3K is not an iterator, it is an iterableMike Bayer2014-08-151-41/+5
| | | | | | | | view. So copy collections.OrderedDict and use MutableMapping to set up keys, items, values on our own OrderedDict. Conflicts: lib/sqlalchemy/engine/base.py
* - The ``info`` parameter has been added to the constructor forMike Bayer2014-08-131-1/+3
| | | | | | | | | | | :class:`.SynonymProperty` and :class:`.ComparableProperty`. - The ``info`` parameter has been added as a constructor argument to all schema constructs including :class:`.MetaData`, :class:`.Index`, :class:`.ForeignKey`, :class:`.ForeignKeyConstraint`, :class:`.UniqueConstraint`, :class:`.PrimaryKeyConstraint`, :class:`.CheckConstraint`. fixes #2963
* - workaround removal of nested() in py3kMike Bayer2014-07-302-1/+35
|
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-206-75/+101
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - Added a "str()" step to the dialect_kwargs iteration forMike Bayer2014-07-142-1/+9
| | | | | | | Python version < 2.6.5, working around the "no unicode keyword arg" bug as these args are passed along as keyword args within some reflection processes. fixes #3123
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-097-7/+14
| | | | to get all flake8 passing
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-262-3/+3
| | | | Found using: https://github.com/intgr/topy
* - Liberalized the contract for :class:`.Index` a bit in that you canMike Bayer2014-04-192-1/+5
| | | | | | | specify a :func:`.text` expression as the target; the index no longer needs to have a table-bound column present if the index is to be manually added to the table, either via inline declaration or via :meth:`.Table.append_constraint`. fixes #3028
* - A major improvement made to the mechanics by which the :class:`.Engine`Mike Bayer2014-03-221-39/+2
| | | | | | | | | | | | recycles the connection pool when a "disconnect" condition is detected; instead of discarding the pool and explicitly closing out connections, the pool is retained and a "generational" timestamp is updated to reflect the current time, thereby causing all existing connections to be recycled when they are next checked out. This greatly simplifies the recycle process, removes the need for "waking up" connect attempts waiting on the old pool and eliminates the race condition that many immediately-discarded "pool" objects could be created during the recycle operation. fixes #2985
* - Added a new keyword argument ``once=True`` to :func:`.event.listen`Mike Bayer2014-03-111-1/+1
| | | | | and :func:`.event.listens_for`. This is a convenience feature which will wrap the given listener such that it is only invoked once.
* - Support has been added for pytest to run tests. This runnerMike Bayer2014-03-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | is currently being supported in addition to nose, and will likely be preferred to nose going forward. The nose plugin system used by SQLAlchemy has been split out so that it works under pytest as well. There are no plans to drop support for nose at the moment and we hope that the test suite itself can continue to remain as agnostic of testing platform as possible. See the file README.unittests.rst for updated information on running tests with pytest. The test plugin system has also been enhanced to support running tests against mutiple database URLs at once, by specifying the ``--db`` and/or ``--dburi`` flags multiple times. This does not run the entire test suite for each database, but instead allows test cases that are specific to certain backends make use of that backend as the test is run. When using pytest as the test runner, the system will also run specific test suites multiple times, once for each database, particularly those tests within the "dialect suite". The plan is that the enhanced system will also be used by Alembic, and allow Alembic to run migration operation tests against multiple backends in one run, including third-party backends not included within Alembic itself. Third party dialects and extensions are also encouraged to standardize on SQLAlchemy's test suite as a basis; see the file README.dialects.rst for background on building out from SQLAlchemy's test platform.
* - get util.get_callable_argspec() to be completely bulletproof for 2.6-3.4,Mike Bayer2014-03-021-11/+33
| | | | | methods, classes, builtins, functools.partial(), everything known so far - use get_callable_argspec() within ColumnDefault._maybe_wrap_callable, re: #2979
* - Fixed some test/feature failures occurring in Python 3.4,Mike Bayer2014-03-021-7/+7
| | | | | | in particular the logic used to wrap "column default" callables wouldn't work properly for Python built-ins. fixes #2979
* - implement kwarg validation and type system for dialect-specificMike Bayer2014-01-181-1/+1
| | | | | arguments; [ticket:2866] - add dialect specific kwarg functionality to ForeignKeyConstraint, ForeignKey
* - happy new yearMike Bayer2014-01-057-7/+7
|
* Merge branch 'automap'Mike Bayer2014-01-052-1/+9
|\ | | | | | | | | Conflicts: doc/build/changelog/changelog_09.rst
| * - conjunctions like and_() and or_() can now accept generators as arguments.Mike Bayer2014-01-052-1/+9
| |
* | - Fixed regression where using a ``functools.partial()`` with the eventMike Bayer2014-01-041-1/+3
|/ | | | | | | | | | | system would cause a recursion overflow due to usage of inspect.getargspec() on it in order to detect a legacy calling signature for certain events, and apparently there's no way to do this with a partial object. Instead we skip the legacy check and assume the modern style; the check itself now only occurs for the SessionEvents.after_bulk_update and SessionEvents.after_bulk_delete events. Those two events will require the new signature style if assigned to a "partial" event listener. [ticket:2905]
* - alter the decorator function, and the newer public_factory function,Mike Bayer2013-12-211-6/+20
| | | | | to use a named def instead of a lambda. this so that TypeError on wrong arguments are more legible. [ticket:2884]
* - Improvements to the system by which SQL types generate withinMike Bayer2013-12-181-31/+54
| | | | | | | | ``__repr__()``, particularly with regards to the MySQL integer/numeric/ character types which feature a wide variety of keyword arguments. The ``__repr__()`` is important for use with Alembic autogenerate for when Python code is rendered in a migration script. [ticket:2893]
* - Made a slight adjustment to the logic which waits for a pooledMike Bayer2013-12-061-2/+8
| | | | | | | | | | | connection to be available, such that for a connection pool with no timeout specified, it will every half a second break out of the wait to check for the so-called "abort" flag, which allows the waiter to break out in case the whole connection pool was dumped; normally the waiter should break out due to a notify_all() but it's possible this notify_all() is missed in very slim cases. This is an extension of logic first introduced in 0.8.0, and the issue has only been observed occasionally in stress tests.
* - adjustment, the spec says: "Within the user and password field, any ":",Mike Bayer2013-11-252-3/+3
| | | | | | | "@", or "/" must be encoded." - so re-apply encoding to both password and username, don't encode spaces as plus signs, don't encode any chars outside of :, @, / on stringification - but we still parse for any %XX character (is that right?)
* - Removed some now unneeded version checks [ticket:2829] courtesy alex gaynorMike Bayer2013-09-221-8/+1
|
* and we don't need weaksetMike Bayer2013-08-182-24/+1
|
* - add WeakSequence.append()Mike Bayer2013-08-181-3/+10
| | | | - fix and test weakref cleanout for WeakSequence, [ticket:2794]
* Fixed a potential issue in an ordered sequence implementation usedMike Bayer2013-08-181-5/+10
| | | | | | | by the ORM to iterate mapper hierarchies; under the Jython interpreter this implementation wasn't ordered, even though cPython and Pypy maintained ordering. Also in 0.8.3. [ticket:2794]
* - spot checking of imports, obsolete functionsMike Bayer2013-08-172-2/+1
|
* 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-92/+98
| | | | | | | | | - 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-122-5/+99
| | | | | | | | | | | | | | | | | | | | | | 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.
* ok forget it, that approach didn't really cover every base, soMike Bayer2013-08-041-16/+29
| | | | we are pretty much back to the beginning, nothing to see here
* - don't need resolve, don't need import for this. just look in sys.modules,Mike Bayer2013-08-041-42/+16
| | | | since we are dealing with cycles in any case.
* don't split the regexps for chop_traceback()Mike Bayer2013-07-121-4/+2
|