summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Ensure Oracle index w/ col DESC etc. is reflectedMike Bayer2017-08-141-0/+4
| | | | | | | | | | | | | | | | | | | | Fixed bug where an index reflected under Oracle with an expression like "column DESC" would not be returned, if the table also had no primary key, as a result of logic that attempts to filter out the index implicitly added by Oracle onto the primary key columns. Reworked the "filter out the primary key index" logic in oracle get_indexes() to be clearer. This changeset also adds an internal check to ColumnCollection to accomodate for the case of a column being added twice, as well as adding a private _table argument to Index such that reflection can specify the Table explicitly. The _table argument can become part of public API in a later revision or release if needed. Change-Id: I745711e03b3e450b7f31185fc70e10d3823063fa Fixes: #4042
* update for 2017 copyrightMike Bayer2017-01-041-1/+1
| | | | Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
* Ensure TypeDecorator delegates _set_parent_with_dispatchMike Bayer2016-10-201-2/+0
| | | | | | | | | | | | | | | | Ensure TypeDecorator delegates _set_parent_with_dispatch as well as _set_parent to itself as well as its impl, as the TypeDecorator class itself may have an active SchemaType implementation as well. Fixed regression which occurred as a side effect of :ticket:`2919`, which in the less typical case of a user-defined :class:`.TypeDecorator` that was also itself an instance of :class:`.SchemaType` (rather than the implementation being such) would cause the column attachment events to be skipped for the type itself. Change-Id: I0afb498fd91ab7d948e4439e7323a89eafcce0bc Fixes: #3832
* - happy new yearMike Bayer2016-01-291-1/+1
|
* - unfortunately we need to match within join where col.key does not matchMike Bayer2016-01-261-2/+1
| | | | | what's given so we need to use a set() here. contains_column is not within any performance paths
* - rework ColumnCollection to no longer persist "all_col_set"; we don'tMike Bayer2016-01-261-20/+9
| | | | | | | | | | | | | need this collection except in the extend/update uses where we create it ad-hoc. simplifies pickling. Compatibility with 1.0 should be OK as ColumnColleciton uses __getstate__ in any case and the __setstate__ contract hasn't changed. - Fixed bug in :class:`.Table` metadata construct which appeared around the 0.9 series where adding columns to a :class:`.Table` that was unpickled would fail to correctly establish the :class:`.Column` within the 'c' collection, leading to issues in areas such as ORM configuration. This could impact use cases such as ``extend_existing`` and others. fixes #3632
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - add MemoizedSlots, a generalized solution to using __getattr__Mike Bayer2015-01-051-9/+12
| | | | | for memoization on a class that uses slots. - apply many more __slots__. mem use for nova now at 46% savings
* - Added a supported :meth:`.FunctionElement.alias` method to functions,Mike Bayer2014-07-241-1/+3
| | | | | | | | | e.g. the ``func`` construct. Previously, behavior for this method was undefined. The current behavior mimics that of pre-0.9.4, which is that the function is turned into a single-column FROM clause with the given alias name, where the column itself is anonymously named. fixes #3137
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-47/+62
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - Added a "str()" step to the dialect_kwargs iteration forMike Bayer2014-07-141-1/+1
| | | | | | | 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-091-1/+2
| | | | to get all flake8 passing
* - Liberalized the contract for :class:`.Index` a bit in that you canMike Bayer2014-04-191-0/+3
| | | | | | | 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
* - Fixed bug in new :meth:`.DialectKWArgs.argument_for` method whereMike Bayer2014-04-151-0/+2
| | | | | adding an argument for a construct not previously included for any special arguments would fail. fixes #3024
* restore the contracts of update/extend to the degree that the same column ↵Mike Bayer2014-02-271-3/+5
| | | | | | identity isn't appended to the list. reflection makes use of this.
* - Some changes to how the :attr:`.FromClause.c` collection behavesMike Bayer2014-02-261-25/+46
| | | | | | | | | | | | | | | | | | | | | | | when presented with duplicate columns. The behavior of emitting a warning and replacing the old column with the same name still remains to some degree; the replacement in particular is to maintain backwards compatibility. However, the replaced column still remains associated with the ``c`` collection now in a collection ``._all_columns``, which is used by constructs such as aliases and unions, to deal with the set of columns in ``c`` more towards what is actually in the list of columns rather than the unique set of key names. This helps with situations where SELECT statements with same-named columns are used in unions and such, so that the union can match the columns up positionally and also there's some chance of :meth:`.FromClause.corresponding_column` still being usable here (it can now return a column that is only in selectable.c._all_columns and not otherwise named). The new collection is underscored as we still need to decide where this list might end up. Theoretically it would become the result of iter(selectable.c), however this would mean that the length of the iteration would no longer match the length of keys(), and that behavior needs to be checked out. fixes #2974 - add a bunch more tests for ColumnCollection
* - use MutableMapping to make this more succinct, completeMike Bayer2014-02-261-47/+35
|
* docsMike Bayer2014-02-251-3/+10
|
* - The new dialect-level keyword argument system for schema-levelMike Bayer2014-02-251-13/+156
| | | | | | | | | constructs has been enhanced in order to assist with existing schemes that rely upon addition of ad-hoc keyword arguments to constructs. - To suit the use case of allowing custom arguments at construction time, the :meth:`.DialectKWArgs.argument_for` method now allows this registration. fixes #2962
* - alter behavior such that dialect_kwargs is still immutable, butMike Bayer2014-01-191-10/+5
| | | | | | now represents exactly the kwargs that were passed, and not the defaults. the defaults are still in dialect_options. This allows repr() schemes such as that of alembic to not need to look through and compare for defaults.
* - implement kwarg validation and type system for dialect-specificMike Bayer2014-01-181-1/+118
| | | | | arguments; [ticket:2866] - add dialect specific kwarg functionality to ForeignKeyConstraint, ForeignKey
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - A rework to the way that "quoted" identifiers are handled, in thatMike Bayer2013-08-271-0/+1
| | | | | | | | | | | | | | | | instead of relying upon various ``quote=True`` flags being passed around, these flags are converted into rich string objects with quoting information included at the point at which they are passed to common schema constructs like :class:`.Table`, :class:`.Column`, etc. This solves the issue of various methods that don't correctly honor the "quote" flag such as :meth:`.Engine.has_table` and related methods. The :class:`.quoted_name` object is a string subclass that can also be used explicitly if needed; the object will hold onto the quoting preferences passed and will also bypass the "name normalization" performed by dialects that standardize on uppercase symbols, such as Oracle, Firebird and DB2. The upshot is that the "uppercase" backends can now work with force-quoted names, such as lowercase-quoted names and new reserved words. [ticket:2812]
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-0/+18
| | | | | | | | | - 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-0/+329
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.