summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/schema.py
Commit message (Collapse)AuthorAgeFilesLines
* expose SchemaVisitor in the compatibility layerpr/57Sean Dague2014-01-111-0/+4
| | | | | | | | sqlalchemy-migrate uses SchemaVisitor. It was one of the only objects that changed namespaces without compatibility that we use. Would love to get this added to remove a work around we need at https://review.openstack.org/#/c/66156/
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - A large refactoring of the ``sqlalchemy.sql`` package has reorganizedMike Bayer2013-08-121-3647/+45
| | | | | | | | | | | | | | | | | | | | | | 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.
* add more docs to index, even though this seems to be a little redundantMike Bayer2013-08-111-10/+29
|
* find some more inline imports and move them outMike Bayer2013-08-041-4/+3
|
* docsMike Bayer2013-06-231-1/+1
|
* doc fixesMike Bayer2013-06-231-5/+6
|
* sort here so that exception messages are testableMike Bayer2013-06-231-1/+1
|
* tweak this for now, would need a testMike Bayer2013-06-231-3/+3
|
* The resolution of :class:`.ForeignKey` objects to theirMike Bayer2013-06-231-110/+234
| | | | | | | | | | | | | | | | | | target :class:`.Column` has been reworked to be as immediate as possible, based on the moment that the target :class:`.Column` is associated with the same :class:`.MetaData` as this :class:`.ForeignKey`, rather than waiting for the first time a join is constructed, or similar. This along with other improvements allows earlier detection of some foreign key configuration issues. Also included here is a rework of the type-propagation system, so that it should be reliable now to set the type as ``None`` on any :class:`.Column` that refers to another via :class:`.ForeignKey` - the type will be copied from the target column as soon as that other column is associated, and now works for composite foreign keys as well. [ticket:1765]
* Fixed bug whereby joining a select() of a table "A" with multipleMike Bayer2013-06-031-1/+2
| | | | | | | | foreign key paths to a table "B", to that table "B", would fail to produce the "ambiguous join condition" error that would be reported if you join table "A" directly to "B"; it would instead produce a join condition with multiple criteria. [ticket:2738]
* Fixed bug whereby using :meth:`.MetaData.reflect` across a remoteMike Bayer2013-06-031-3/+12
| | | | | | schema as well as a local schema could produce wrong results in the case where both schemas had a table of the same name. [ticket:2728]
* a pass where we try to squash down as many list()/keys() combinationsMike Bayer2013-05-261-1/+1
| | | | as possible
* Merge branch 'master' into rel_0_9Mike Bayer2013-05-261-1/+1
|\
| * fix incorrect method nameChris Withers2013-05-261-1/+1
| |
* | - endless isinstance(x, str)s....Mike Bayer2013-04-281-36/+30
| |
* | plugging awayMike Bayer2013-04-271-18/+9
| |
* | - the raw 2to3 runMike Bayer2013-04-271-47/+50
|/ | | | - went through examples/ and cleaned out excess list() calls
* Loosened the check on dialect-specific argument namesMike Bayer2013-03-241-8/+7
| | | | | | | passed to Table(); since we want to support external dialects and also want to support args without a certain dialect being installed, it only checks the format of the arg now, rather than looking for that dialect in sqlalchemy.dialects.
* - auto-append for CheckConstraint should skip table if the expression is againstMike Bayer2013-03-091-2/+2
| | | | a lower-case-t table
* Added a new argument to :class:`.Enum` and its baseMike Bayer2013-02-011-3/+17
| | | | | | | | | | | | :class:`.SchemaType` ``inherit_schema``. When set to ``True``, the type will set its ``schema`` attribute of that of the :class:`.Table` to which it is associated. This also occurs during a :meth:`.Table.tometadata` operation; the :class:`.SchemaType` is now copied in all cases when :meth:`.Table.tometadata` happens, and if ``inherit_schema=True``, the type will take on the new schema name passed to the method. The ``schema`` is important when used with the Postgresql backend, as the type results in a ``CREATE TYPE`` statement. [ticket:2657]
* Fixed bug where :meth:`.Table.tometadata` would fail if aMike Bayer2013-01-271-1/+1
| | | | | | :class:`.Column` had both a foreign key as well as an alternate ".key" name for the column. Also in 0.7.10. [ticket:2643]
* - replace mssql_ordering with generalized #695 solutionMike Bayer2013-01-201-6/+9
| | | | - documentation for mssql index options plus changelog and fixes
* :class:`.Index` now supports arbitrary SQL expressions and/orMike Bayer2013-01-161-6/+36
| | | | | | | | functions, in addition to straight columns. Common modifiers include using ``somecolumn.desc()`` for a descending index and ``func.lower(somecolumn)`` for a case-insensitive index, depending on the capabilities of the target backend. [ticket:695]
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* Fixed a regression caused by :ticket:`2410` whereby aMike Bayer2012-12-111-9/+22
| | | | | | | | | :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]
* Fixed bug where using server_onupdate=<FetchedValue|DefaultClause>Mike Bayer2012-12-081-2/+15
| | | | | | | | | | without passing the "for_update=True" flag would apply the default object to the server_default, blowing away whatever was there. The explicit for_update=True argument shouldn't be needed with this usage (especially since the documentation shows an example without it being used) so it is now arranged internally using a copy of the given default object, if the flag isn't set to what corresponds to that argument. Also in 0.7.10. [ticket:2631]
* Fixed bug whereby using a label_length on dialect that was smallerMike Bayer2012-12-081-2/+4
| | | | | | than the size of actual column identifiers would fail to render the columns correctly in a SELECT statement. [ticket:2610]
* fixing broken links (see #2625)Diana Clarke2012-12-051-12/+11
|
* just a pep8 pass of lib/sqlalchemy/Diana Clarke2012-11-191-71/+120
|
* The :meth:`.Connection.connect` and :meth:`.Connection.contextual_connect`Mike Bayer2012-11-141-18/+10
| | | | | | | methods now return a "branched" version so that the :meth:`.Connection.close` method can be called on the returned connection without affecting the original. Allows symmetry when using :class:`.Engine` and :class:`.Connection` objects as context managers.
* Fixed :meth:`.MetaData.reflect` to correctly useMike Bayer2012-11-141-8/+17
| | | | | | the given :class:`.Connection`, if given, without opening a second connection from that connection's :class:`.Engine`. [ticket:2604]
* add docs regarding fetchedvalue with primary keys, [ticket:2598]Mike Bayer2012-11-121-0/+4
|
* Fixed bug whereby the ".key" of a Column wasn't beingMike Bayer2012-10-311-1/+1
| | | | | | | used when producing a "proxy" of the column against a selectable. This probably didn't occur in 0.7 since 0.7 doesn't respect the ".key" in a wider range of scenarios. [ticket:2597]
* - [feature] Added TIME type to mysql dialect,Mike Bayer2012-10-101-8/+10
| | | | | | | | | | | | accepts "fst" argument which is the new "fractional seconds" specifier for recent MySQL versions. The datatype will interpret a microseconds portion received from the driver, however note that at this time most/all MySQL DBAPIs do not support returning this value. [ticket:2534] - attempted to modernize the types tests in test_mysql a little, though has a long way to go
* - fix the fixture here that wasn't creating consistentlyMike Bayer2012-10-011-2/+22
| | | | | | | - rewrite --dropfirst to be more industrial strength, includes views - fix order_by="foreign_key" to maintain the same ordering as metadata.sorted_tables. Not ideal that this was the other way throughout 0.7 but this is still a little-used method, in contrast to metadata.sorted_tables.
* - [bug] When the primary key column of a TableMike Bayer2012-09-231-11/+13
| | | | | | | | 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] An explicit error is raised whenMike Bayer2012-09-231-3/+21
| | | | | | a ForeignKeyConstraint() that was constructed to refer to multiple remote tables is first used. [ticket:2455]
* - [feature] Added a hook to the system of renderingMike Bayer2012-09-091-0/+88
| | | | | | | CREATE TABLE that provides access to the render for each Column individually, by constructing a @compiles function against the new schema.CreateColumn construct. [ticket:2463]
* fixMike Bayer2012-09-091-2/+0
|
* almost obliterate the concept of "implicit execution" from the docs, move it ↵Mike Bayer2012-09-091-4/+13
| | | | | | | | only to the "engines and connections" chapter nobody reads, put big green "note:" boxes with the word "discouraged" in them for "bound metadata", "implicit execution", "threadlocal strategy"
* call this "_proxies" since it's not really a public consumption attributeMike Bayer2012-08-271-1/+1
|
* - [feature] Added support for .info dictionary argument toMike Bayer2012-08-241-14/+12
| | | | | | column_property(), relationship(), composite(). All MapperProperty classes have an auto-creating .info dict available overall.
* - [bug] Fixes to the interpretation of theMike Bayer2012-08-201-8/+44
| | | | | | Column "default" parameter as a callable to not pass ExecutionContext into a keyword argument parameter. [ticket:2520]
* - modernize most of the postgis example. would like to do [ticket:1534] also.Mike Bayer2012-08-161-0/+10
| | | | | - we don't have coverage for type-wide instrumentation events, the listener was broke. could break again too.
* move the whole thing to TypeEngine. the feature is pretty much for free ↵Mike Bayer2012-08-131-11/+1
| | | | like this.
* - develop new system of applying custom operators to ColumnElement classes. ↵Mike Bayer2012-08-131-1/+11
| | | | | | resembles that of the ORM so far.
* - rework some more __clause_element__ methods to use inspection, but theres ↵Mike Bayer2012-07-231-163/+167
| | | | a ton more of these
* - a big renaming of all the _Underscore classes to haveMike Bayer2012-07-171-1/+1
| | | | | | plain names. The old names are still defined for backwards compatibility. - _BindParamClause renamed to BindParameter
* absolute imports in core, sqlMike Bayer2012-06-231-4/+2
|