summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/schema.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - [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]
* - Modified Column.copy() to use _constructor(),Mike Bayer2011-09-231-1/+1
| | | | | | which defaults to self.__class__, in order to create the new object. This allows easier support of subclassing Column. [ticket:2284]
* - Added a slightly nicer __repr__() to SchemaItemMike Bayer2011-08-141-18/+10
| | | | | | | | classes. Note the repr here can't fully support the "repr is the constructor" idea since schema items can be very deeply nested/cyclical, have late initialization of some things, etc. [ticket:2223]
* some core cross linkageMike Bayer2011-08-071-5/+16
|
* - Added an informative error message whenMike Bayer2011-07-211-1/+7
| | | | | | | | | ForeignKeyConstraint refers to a column name in the parent that is not found. Also in 0.6.9. - add tests for [ticket:2226], as if we hit each @declared_attr directly with obj.__get__(obj, name) instead of using getattr(cls, name). Basic inheritance mechanics are improperly used in this case, so 2226 is invalid.
* - Added new "postgresql_ops" argument toMike Bayer2011-07-201-1/+7
| | | | | | Index, allows specification of PostgreSQL operator classes for indexed columns. [ticket:2198] Courtesy Filip Zyzniewski.
* - Fixed bug where "autoincrement" detection onMike Bayer2011-06-301-0/+1
| | | | | | | Table would fail if the type had no "affinity" value, in particular this would occur when using the UUID example on the site that uses TypeEngine as the "impl".
* - Fixed bug whereby adaptation of old append_ddl_listener()Mike Bayer2011-06-301-2/+3
| | | | | | | function was passing unexpected **kw through to the Table event. Table gets no kws, the MetaData event in 0.6 would get "tables=somecollection", this behavior is preserved. [ticket:2206]
* - Deprecate schema/SQL-oriented methods onMike Bayer2011-06-021-17/+57
| | | | | | | Connection/Engine that were never well known and are redundant: reflecttable(), create(), drop(), text(), engine.func - lots of docstrings in engine
* - Fixed bug whereby metadata.reflect(bind)Mike Bayer2011-06-011-1/+2
| | | | | would close a Connection passed as a bind argument. Regression from 0.6.
* - Changed the handling in determination of joinMike Bayer2011-05-071-2/+4
| | | | | | | | | | | conditions such that foreign key errors are only considered between the two given tables. That is, t1.join(t2) will report FK errors that involve 't1' or 't2', but anything involving 't3' will be skipped. This affects join(), as well as ORM relationship and inherit condition logic. Will keep the more conservative approach to [ticket:2153] in 0.6.
* - metadata.reflect() and reflection.Inspector()Mike Bayer2011-04-231-22/+26
| | | | | | had some reliance on GC to close connections which were internally procured, fixed this. - added --zero-timeout option to nose fixture, sets pool_timeout to zero
* - Fixed bug whereby if FetchedValue was passedMike Bayer2011-04-231-1/+1
| | | | | | | to column server_onupdate, it would not have its parent "column" assigned, added test coverage for all column default assignment patterns. [ticket:2147] also in 0.6.8
* - Added explicit check for when Column .nameMike Bayer2011-04-201-4/+6
| | | | is assigned as blank string [ticket:2140]
* - Before/after attach events for PrimaryKeyConstraintMike Bayer2011-04-171-10/+9
| | | | | now function, tests added for before/after events on all constraint types. [ticket:2105]
* a crapload of doc tweaks including [ticket:1666], thanks Toby !Mike Bayer2011-04-161-3/+40
|
* - The 'useexisting' flag on Table has been supercededMike Bayer2011-04-051-15/+55
| | | | | | | | | | | by a new pair of flags 'keep_existing' and 'extend_existing'. 'extend_existing' is equivalent to 'useexisting' - the existing Table is returned, and additional constructor elements are added. With 'keep_existing', the existing Table is returned, but additional constructor elements are not added - these elements are only applied when the Table is newly created. [ticket:2109]
* - adjust the previous checkin a bit. need to transfer sequences over from ↵Mike Bayer2011-03-231-4/+6
| | | | | | | | | | pickle even if they are *not* restated. its necessary here to do a "replacement" scheme when an incoming sequence replaces the previous. Theoretically we could do what Table does here, i.e. use a singleton constructor, but this is heavyhanded. The most recent sequence placed in is the winner is likely the most expected behavior.
* - Fixed regression whereby MetaData() comingMike Bayer2011-03-231-2/+3
| | | | | | | back from unpickling did not keep track of new things it keeps track of now, i.e. collection of Sequence objects, list of schema names. [ticket:2104]
* - Added new generic function "next_value()", acceptsMike Bayer2011-03-201-15/+43
| | | | | | | | | | | | | | | | | | | | a Sequence object as its argument and renders the appropriate "next value" generation string on the target platform, if supported. Also provides ".next_value()" method on Sequence itself. [ticket:2085] - added tests for all the conditions described in [ticket:2085] - postgresql dialect will exec/compile a Sequence that has "optional=True". the optional flag is now only checked specifically in the context of a Table primary key evaulation. - func.next_value() or other SQL expression can be embedded directly into an insert() construct, and if implicit or explicit "returning" is used in conjunction with a primary key column, the newly generated value will be present in result.inserted_primary_key. [ticket:2084]
* - some doc reorgMike Bayer2011-03-171-60/+60
| | | | | | | | | | - change engine.Connection to _connection_cls so sphinx doesn't get upset - globally add "." to all :class:`Foo` - start naming sections that are mostly docstrings "API Documentation - blah blah" - move some ad-hoc docstrings into "API" sections, there is some inconsistency here and it may be that we just have to leave it that way - add "internals" rsts to core, orm, I'm not super thrilled how these look but they are targeted by some of the public api docs, users typically become aware of these anyway
* initial work on column reflectMike Bayer2011-03-141-0/+21
|
* Warn about unicode column having non-unicode default. See #2079.Diana Clarke2011-03-141-0/+8
|
* fix "associated" at the source tooMike Bayer2011-03-141-1/+1
|
* - Added a fully descriptive error message for theMike Bayer2011-02-281-7/+26
| | | | | | | case where Column is subclassed and _make_proxy() fails to make a copy due to TypeError on the constructor. The method _constructor should be implemented in this case.
* - establish an "insert" option for events to control ordering if needed (not ↵Mike Bayer2011-02-251-0/+7
| | | | | | needed yet tho) - render foreign key constraints in the order in which they were cerated
* - The Column.references() method now returns TrueMike Bayer2011-02-171-1/+1
| | | | | | if it has a foreign key referencing the given column exactly, not just it's parent table. [ticket:2064]
* - The Sequence() construct, when passed a MetaData()Mike Bayer2011-02-131-6/+97
| | | | | | | object via its 'metadata' argument, will be included in CREATE/DROP statements within metadata.create_all() and metadata.drop_all(), including "checkfirst" logic. [ticket:2055]
* - remove some remaining sys.modules shenanigansrel_0_7b1Mike Bayer2011-02-121-6/+6
| | | | | | | | | - The "sqlalchemy.exceptions" alias in sys.modules has been removed. Base SQLA exceptions are available via "from sqlalchemy import exc". The "exceptions" alias for "exc" remains in "sqlalchemy" for now, it's just not patched into sys.modules.
* - schema.copy() functions will copy dispatch, but only for those eventsMike Bayer2011-02-011-5/+16
| | | | | | | | | added with propagate=True. needs tests - oracle/fb test schema uses event w/ propagate=True to apply Sequence to primary key columns with test_needs_autoincrement. this does actually test the propagate=True flag a bit since it's needed in the declarative mixin tests where the 'id' column is copied.
* - SchemaItem, SchemaType now descend from common typeMike Bayer2011-01-301-38/+23
| | | | | | | | | | | | | | | | | | SchemaEventTarget, which supplies dispatch - the dispatch now provides before_parent_attach(), after_parent_attach(), events which generally bound the _set_parent() event. [ticket:2037] - the _on_table_attach mechanism now usually uses the event dispatch - fixed class-level event dispatch to propagate to all subclasses, not just immediate subclasses - fixed class-level event unpickling to handle more involved inheritance hierarchies, needed by the new schema event dispatch. - ForeignKeyConstraint doesn't re-call the column attach event on ForeignKey objects that are already associated with the correct Column - we still need that ImportError on mysqldb CLIENT FLAGS to support mock DBAPIs
* - Column.copy(), as used in table.tometadata(), copies theMike Bayer2011-01-301-0/+1
| | | | 'doc' attribute. [ticket:2028]