summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/util/langhelpers.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* - 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-311-10/+41
| | | | | | | | | 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-281-0/+8
| | | | | | | | | | | 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
* - 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
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-44/+61
| | | | 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
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-1/+1
| | | | Found using: https://github.com/intgr/topy
* - 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-051-1/+1
|
* - 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]
* - spot checking of imports, obsolete functionsMike Bayer2013-08-171-1/+1
|
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-91/+97
| | | | | | | | | - 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/+98
| | | | | | | | | | | | | | | | | | | | | | 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
|
* Dialect.initialize() is not called a second time if an :class:`.Engine`Mike Bayer2013-07-111-0/+14
| | | | | | is recreated, due to a disconnect error. This fixes a particular issue in the Oracle 8 dialect, but in general the dialect.initialize() phase should only be once per dialect. Also in 0.8.3. [ticket:2776]
* - create a new system where we can decorate an event methodMike Bayer2013-07-081-2/+14
| | | | | | | | | | | | | | | | 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]
* remove all remaining start/end py2k/py3k blocksMike Bayer2013-06-071-1/+1
|
* merge defaultMike Bayer2013-05-231-24/+22
|\
| * Fixed a bug where the routine to detect the correct kwargsMike Bayer2013-05-231-24/+22
| | | | | | | | | | | | being sent to :func:`.create_engine` would fail in some cases, such as with the Sybase dialect. [ticket:2732]
* | most of ORM passing...Mike Bayer2013-05-041-6/+1
| |
* | - endless isinstance(x, str)s....Mike Bayer2013-04-281-54/+47
| |
* | plugging awayMike Bayer2013-04-271-21/+19
| |
* | - the raw 2to3 runMike Bayer2013-04-271-66/+73
|/ | | | - went through examples/ and cleaned out excess list() calls
* - remove reference to _exc_info before reraise to reduce cyclesMike Bayer2013-04-181-0/+3
|
* Reworked internal exception raises that emitMike Bayer2013-04-181-0/+29
| | | | | | | | | 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]
* - remove all compat items that are pre-2.5 (hooray)Mike Bayer2013-03-091-4/+24
| | | | | | - other cleanup - don't need compat.decimal, that approach never panned out. hopefully outside libs aren't pulling it in, they shouldn't be
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* Fixed a regression caused by :ticket:`2410` whereby aMike Bayer2012-12-111-4/+6
| | | | | | | | | :class:`.CheckConstraint` would apply itself back to the original table during a :meth:`.Table.tometadata` operation, as it would parse the SQL expression for a parent table. The operation now copies the given expression to correspond to the new table. [ticket:2633]
* just a pep8 pass of lib/sqlalchemy/util/Diana Clarke2012-11-191-11/+51
|
* - [bug] TypeDecorator now includes a generic repr()Mike Bayer2012-10-181-2/+4
| | | | | | | | | that works in terms of the "impl" type by default. This is a behavioral change for those TypeDecorator classes that specify a custom __init__ method; those types will need to re-define __repr__() if they need __repr__() to provide a faithful constructor representation. [ticket:2594]
* - fix annotation transfer when producing m2m backref, [ticket:2578]Mike Bayer2012-09-281-0/+3
|
* - use our new Cls.memoized_name._reset(self) method in place of all those ↵Mike Bayer2012-09-231-3/+0
| | | | | | __dict__.pop(), remove reset_memoized
* - [bug] When the primary key column of a TableMike Bayer2012-09-231-0/+2
| | | | | | | | is replaced, such as via extend_existing, the "auto increment" column used by insert() constructs is reset. Previously it would remain referring to the previous primary key column. [ticket:2525]
* - [feature] The Core oeprator system now includesMike Bayer2012-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the `getitem` operator, i.e. the bracket operator in Python. This is used at first to provide index and slice behavior to the Postgresql ARRAY type, and also provides a hook for end-user definition of custom __getitem__ schemes which can be applied at the type level as well as within ORM-level custom operator schemes. Note that this change has the effect that descriptor-based __getitem__ schemes used by the ORM in conjunction with synonym() or other "descriptor-wrapped" schemes will need to start using a custom comparator in order to maintain this behavior. - [feature] postgresql.ARRAY now supports indexing and slicing. The Python [] operator is available on all SQL expressions that are of type ARRAY; integer or simple slices can be passed. The slices can also be used on the assignment side in the SET clause of an UPDATE statement by passing them into Update.values(); see the docs for examples. - [feature] Added new "array literal" construct postgresql.array(). Basically a "tuple" that renders as ARRAY[1,2,3].
* - [bug] Fixed the repr() of Enum to includeMike Bayer2012-08-081-1/+10
| | | | | the "name" and "native_enum" flags. Helps Alembic autogenerate.
* more import cleanupsMike Bayer2012-08-071-3/+3
|
* - document the inspection systemMike Bayer2012-07-181-13/+16
|
* - [moved] The InstrumentationManager interfaceMike Bayer2012-06-241-1/+14
| | | | | | | | | | | | | and the entire related system of alternate class implementation is now moved out to sqlalchemy.ext.instrumentation. This is a seldom used system that adds significant complexity and overhead to the mechanics of class instrumentation. The new architecture allows it to remain unused until InstrumentationManager is actually imported, at which point it is bootstrapped into the core.
* - [feature] Added a new systemMike Bayer2012-04-241-0/+39
| | | | | | | for registration of new dialects in-process without using an entrypoint. See the docs for "Registering New Dialects". [ticket:2462]
* - merge attribute flag overhaul for [ticket:2358]Mike Bayer2012-04-231-7/+13
|