summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/schema.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - 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
|
* - [feature] Added "MATCH" clause to ForeignKey,Mike Bayer2012-06-211-5/+19
| | | | | ForeignKeyConstraint, courtesy Ryan Kelly. [ticket:2502]
* Add some `Sphinx` paragraph level versions informations markups,Mike Bayer2012-06-081-26/+40
| | | | such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
* - [bug] All of UniqueConstraint, ForeignKeyConstraint,Mike Bayer2012-04-241-0/+13
| | | | | | | | | | | CheckConstraint, and PrimaryKeyConstraint will attach themselves to their parent table automatically when they refer to a Table-bound Column object directly (i.e. not just string column name), and refer to one and only one Table. Prior to 0.8 this behavior occurred for UniqueConstraint and PrimaryKeyConstraint, but not ForeignKeyConstraint or CheckConstraint. [ticket:2410]
* - [bug] The names of the columns on theMike Bayer2012-04-241-2/+2
| | | | | | | | .c. attribute of a select().apply_labels() is now based on <tablename>_<colkey> instead of <tablename>_<colname>, for those columns that have a distinctly named .key. [ticket:2397]
* - sqlMike Bayer2012-04-011-2/+0
| | | | | | | | | | | | | | | - [bug] Removed warning when Index is created with no columns; while this might not be what the user intended, it is a valid use case as an Index could be a placeholder for just an index of a certain name. - mssql - [feature] Added interim create_engine flag supports_unicode_binds to PyODBC dialect, to force whether or not the dialect passes Python unicode literals to PyODBC or not.
* - [feature] Added support for MySQL index andMike Bayer2012-03-141-9/+20
| | | | | | | primary key constraint types (i.e. USING) via new mysql_using parameter to Index and PrimaryKeyConstraint, courtesy Diana Clarke. [ticket:2386]
* - expand the check to determine if a selectable column is embeddedMike Bayer2012-02-291-0/+2
| | | | | | | | | | in the corresponding selectable to take into account clones of the target column. fixes [ticket:2419] - have _make_proxy() copy out the _is_clone_of attribute on the new column so that even more corresponding_column() checks work as expected for cloned elements. - add a new test fixture so that mapped tests can be specified using declarative.
* - [bug] Index will raise when arguments passedMike Bayer2012-02-121-3/+7
| | | | | | cannot be interpreted as columns or expressions. Will warn when Index is created with no columns at all. [ticket:2380]
* - [bug] Fixed bug in new "autoload_replace" flagMike Bayer2012-02-121-3/+6
| | | | | | which would fail to preserve the primary key constraint of the reflected table. [ticket:2402]
* - [bug] A significant change to how labelingMike Bayer2012-02-051-2/+2
| | | | | | | | | | | | | | is applied to columns in SELECT statements allows "truncated" labels, that is label names that are generated in Python which exceed the maximum identifier length (note this is configurable via label_length on create_engine()), to be properly referenced when rendered inside of a subquery, as well as to be present in a result set row using their original in-Python names. [ticket:2396] - apply pep8 to test_labels
* - [feature] New reflection feature "autoload_replace";Mike Bayer2012-01-281-51/+71
| | | | | | | | | | | | | | | when set to False on Table, the Table can be autoloaded without existing columns being replaced. Allows more flexible chains of Table construction/reflection to be constructed, including that it helps with combining Declarative with table reflection. See the new example on the wiki. [ticket:2356] - [bug] Improved the API for add_column() such that if the same column is added to its own table, an error is not raised and the constraints don't get doubled up. Also helps with some reflection/declarative patterns. [ticket:2356]
* happy new yearMike Bayer2012-01-041-1/+1
|
* - doc updates per [ticket:2251]Mike Bayer2011-12-061-2/+9
| | | | | | | | - [feature] Added new value for Column autoincrement called "ignore_fk", can be used to force autoincrement on a column that's still part of a ForeignKeyConstraint. New example in the relationship docs illustrates its use.
* - reflection process always resets the primary key constraintMike Bayer2011-12-041-0/+3
| | | | first, fixes extend_existing
* - [feature] The "extend_existing" flag on TableMike Bayer2011-12-041-18/+45
| | | | | | | | | | | | | now allows for the reflection process to take effect for a Table object that's already been defined; when autoload=True and extend_existing=True are both set, the full set of columns will be reflected from the Table which will then *overwrite* those columns already present, rather than no activity occurring. Columns that are present directly in the autoload run will be used as always, however. [ticket:1410]
* - [feature] Added new support for remote "schemas":Mike Bayer2011-10-231-4/+83
| | | | | | | | | | | | | | | | | | | | | | | | - MetaData() accepts "schema" and "quote_schema" arguments, which will be applied to the same-named arguments of a Table or Sequence which leaves these at their default of ``None``. - Sequence accepts "quote_schema" argument - tometadata() for Table will use the "schema" of the incoming MetaData for the new Table if the schema argument is explicitly "None" - Added CreateSchema and DropSchema DDL constructs - these accept just the string name of a schema and a "quote" flag. - When using default "schema" with MetaData, ForeignKey will also assume the "default" schema when locating remote table. This allows the "schema" argument on MetaData to be applied to any set of Table objects that otherwise don't have a "schema". - a "has_schema" method has been implemented on dialect, but only works on Postgresql so far. Courtesy Manlio Perillo, [ticket:1679]
* Backed out changeset 8ef278ec7557a5b3446807e9bc16624630ffd034Mike Bayer2011-10-231-22/+16
|
* fix the 2to3 hereMike Bayer2011-10-231-16/+22
|
* - adjust some tests and such to work better with a mysql 5.5 installMike Bayer2011-10-111-0/+2
| | | | | - Added mysql_length parameter to Index construct, specifies "length" for indexes. [ticket:2293]