summaryrefslogtreecommitdiff
path: root/test/sql/test_metadata.py
Commit message (Collapse)AuthorAgeFilesLines
* - The :class:`.ForeignKey` class more aggressively checks the givenMike Bayer2013-12-111-1/+40
| | | | | | | | | column argument. If not a string, it checks that the object is at least a :class:`.ColumnClause`, or an object that resolves to one, and that the ``.table`` attribute, if present, refers to a :class:`.TableClause` or subclass, and not something like an :class:`.Alias`. Otherwise, a :class:`.ArgumentError` is raised. [ticket:2883]
* - The :meth:`.Table.tometadata` method now produces copies ofMike Bayer2013-10-181-1/+41
| | | | | | | | | | all :attr:`.SchemaItem.info` dictionaries from all :class:`.SchemaItem` objects within the structure including columns, constraints, foreign keys, etc. As these dictionaries are copies, they are independent of the original dictionary. Previously, only the ``.info`` dictionary of :class:`.Column` was transferred within this operation, and it was only linked in place, not copied. [ticket:2716]
* The ``.unique`` flag on :class:`.Index` could be produced as ``None``Mike Bayer2013-10-141-0/+22
| | | | | | if it was generated from a :class:`.Column` that didn't specify ``unique`` (where it defaults to ``None``). The flag will now always be ``True`` or ``False``. [ticket:2825]
* The "name" attribute is set on :class:`.Index` before the "attach"Mike Bayer2013-10-111-4/+9
| | | | | | events are called, so that attachment events can be used to dynamically generate a name for the index based on the parent table and/or columns. [ticket:2835]
* - these tests now fail on a normalize name DB, as they should! because we're ↵Mike Bayer2013-08-281-0/+6
| | | | quoting the lowercase name.
* - A rework to the way that "quoted" identifiers are handled, in thatMike Bayer2013-08-271-12/+20
| | | | | | | | | | | | | | | | 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]
* tweak this for now, would need a testMike Bayer2013-06-231-11/+0
|
* The resolution of :class:`.ForeignKey` objects to theirMike Bayer2013-06-231-33/+317
| | | | | | | | | | | | | | | | | | 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-0/+24
| | | | | | | | 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]
* - the raw 2to3 runMike Bayer2013-04-271-2/+2
| | | | - went through examples/ and cleaned out excess list() calls
* - :meth:`.MetaData.create_all` and :meth:`.MetaData.drop_all` willMike Bayer2013-03-021-0/+1
| | | | | | | | | | now accommodate an empty list as an instruction to not create/drop any items, rather than ignoring the collection. [ticket:2664]. This is a behavioral change and extra notes to the changelog and migration document have been added. - create a new test suite for exercising codepaths in engine/ddl.py
* - some linter cleanup, though have disabled the newer linter rules which are ↵Mike Bayer2013-03-021-40/+45
| | | | | | just too much for now
* Added a new argument to :class:`.Enum` and its baseMike Bayer2013-02-011-1/+98
| | | | | | | | | | | | :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-0/+12
| | | | | | :class:`.Column` had both a foreign key as well as an alternate ".key" name for the column. Also in 0.7.10. [ticket:2643]
* Fixed bug where using server_onupdate=<FetchedValue|DefaultClause>Mike Bayer2012-12-081-0/+31
| | | | | | | | | | 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]
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-271-8/+8
| | | | | | | become an externally usable package but still remains within the main sqlalchemy parent package. in this system, we use kind of an ugly hack to get the noseplugin imported outside of the "sqlalchemy" package, while still making it available within sqlalchemy for usage by third party libraries.
* - [bug] When the primary key column of a TableMike Bayer2012-09-231-1/+16
| | | | | | | | 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-0/+28
| | | | | | a ForeignKeyConstraint() that was constructed to refer to multiple remote tables is first used. [ticket:2455]
* - clean pyflakesMike Bayer2012-09-231-50/+48
|
* finished fixes for mxodbc; need to use at least version 3.2.1Mike Bayer2012-09-211-0/+1
|
* - [feature] Added a hook to the system of renderingMike Bayer2012-09-091-0/+42
| | | | | | | 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]
* fixes to prevent the new MyISAM engine from breaking other testsMike Bayer2012-08-291-0/+1
|
* - adjustments for py3.3 unit tests, [ticket:2542]Mike Bayer2012-08-111-1/+1
|
* -whitespace bonanza, contdMike Bayer2012-07-281-52/+52
|
* - [bug] Index will raise when arguments passedMike Bayer2012-02-121-1/+1
| | | | | | cannot be interpreted as columns or expressions. Will warn when Index is created with no columns at all. [ticket:2380]
* - [feature] New reflection feature "autoload_replace";Mike Bayer2012-01-281-0/+11
| | | | | | | | | | | | | | | 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]
* - [feature] Added new support for remote "schemas":Mike Bayer2011-10-231-28/+164
| | | | | | | | | | | | | | | | | | | | | | | | - 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]
* - Modified Column.copy() to use _constructor(),Mike Bayer2011-09-231-0/+15
| | | | | | 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-17/+39
| | | | | | | | 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]
* - Added an informative error message whenMike Bayer2011-07-211-0/+33
| | | | | | | | | 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.
* - Fixed bug whereby if FetchedValue was passedMike Bayer2011-04-231-0/+78
| | | | | | | 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-3/+25
| | | | is assigned as blank string [ticket:2140]
* - Before/after attach events for PrimaryKeyConstraintMike Bayer2011-04-171-4/+48
| | | | | now function, tests added for before/after events on all constraint types. [ticket:2105]
* - The 'useexisting' flag on Table has been supercededMike Bayer2011-04-051-6/+222
| | | | | | | | | | | 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]
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-8/+10
| | | | | | | classes to a new test.lib.fixtures module - move testing.TestBase to test.lib.fixtures - massive search and replace
* - convert @provide_metadata to use self accessMike Bayer2011-03-261-0/+1
| | | | | - having occasional issues with BasicEntity grabbing, if it persists may have to pass an explicit base class into setup_classes()/setup_mappers()
* - adjust the previous checkin a bit. need to transfer sequences over from ↵Mike Bayer2011-03-231-3/+37
| | | | | | | | | | 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-3/+36
| | | | | | | 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 a fully descriptive error message for theMike Bayer2011-02-281-2/+74
| | | | | | | 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.
* - The Column.references() method now returns TrueMike Bayer2011-02-171-0/+46
| | | | | | if it has a foreign key referencing the given column exactly, not just it's parent table. [ticket:2064]
* - SchemaItem, SchemaType now descend from common typeMike Bayer2011-01-301-3/+51
| | | | | | | | | | | | | | | | | | 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-2/+3
| | | | 'doc' attribute. [ticket:2028]
* - merge r43460573c27a:4993c7eae8e5d117ff342bdc59f3b0635b898e2c of 0.6 branchMike Bayer2011-01-081-0/+14
|
* - whitespace removal bonanzaMike Bayer2011-01-021-32/+31
|
* combine test/engine/test_metadata.py and test/sql/test_columns.py into newMike Bayer2010-11-281-0/+573
test/sql/test_metadata.py, [ticket:1970]