summaryrefslogtreecommitdiff
path: root/test/engine/test_reflection.py
Commit message (Collapse)AuthorAgeFilesLines
* Add basic support of unique constraints reflectionpr/4Roman Podolyaka2013-06-091-0/+37
| | | | | | | | | | | | Inspection API already supports reflection of table indexes information and those also include unique constraints (at least for PostgreSQL and MySQL). But it could be actually useful to distinguish between indexes and plain unique constraints (though both are implemented in the same way internally in RDBMS). This change adds a new method to Inspection API - get_unique_constraints() and implements it for SQLite, PostgreSQL and MySQL dialects.
* - clean up some of the requires for cross-schema reflectionMike Bayer2013-06-031-7/+4
| | | | - add oracle profile counts
* Fixed bug whereby using :meth:`.MetaData.reflect` across a remoteMike Bayer2013-06-031-0/+24
| | | | | | 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]
* that's all of engineMike Bayer2013-05-041-6/+8
|
* cleanupMike Bayer2013-05-041-79/+78
|
* - the raw 2to3 runMike Bayer2013-04-271-9/+9
| | | | - went through examples/ and cleaned out excess list() calls
* - adding in requirementsMike Bayer2013-02-061-3/+3
| | | | - get test_naturalpks to be more generalized
* Fixed :meth:`.MetaData.reflect` to correctly useMike Bayer2012-11-141-10/+37
| | | | | | the given :class:`.Connection`, if given, without opening a second connection from that connection's :class:`.Engine`. [ticket:2604]
* - test updatesMike Bayer2012-10-041-5/+7
|
* - more tests, move some tests out of test_reflection, test_queryMike Bayer2012-09-271-317/+0
|
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-271-4/+5
| | | | | | | 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.
* -whitespace bonanza, contdMike Bayer2012-07-281-45/+45
|
* - [feature] The "deferred declarativeMike Bayer2012-05-171-1/+50
| | | | | | | | | | | | | | | | reflection" system has been moved into the declarative extension itself, using the new DeferredReflection class. This class is now tested with both single and joined table inheritance use cases. [ticket:2485] - [bug] The autoload_replace flag on Table, when False, will cause any reflected foreign key constraints which refer to already-declared columns to be skipped, assuming that the in-Python declared column will take over the task of specifying in-Python ForeignKey or ForeignKeyConstraint declarations.
* - [feature] Inspector.get_primary_keys() isMike Bayer2012-04-241-16/+30
|\ | | | | | | | | | | | | | | deprecated; use Inspector.get_pk_constraint(). Courtesy Diana Clarke. [ticket:2422] - restored default get_primary_keys()/get_pk_constraint() wrapper to help maintain compatibility with third party dialects created against 0.6 or 0.7
| * deprecate inspector.get_primary_keys() in favor of inspector.get_pk_constraint()Diana Clarke2012-04-021-17/+30
| | | | | | | | - see #2422
* | - [feature] The column_reflect event nowMike Bayer2012-04-241-1/+1
| | | | | | | | | | | | | | | | | | accepts the Inspector object as the first argument, preceding "table". Code which uses the 0.7 version of this very new event will need modification to add the "inspector" object as the first argument. [ticket:2418]
* | begin implementing inspection system for #2208Mike Bayer2012-04-031-16/+13
|/
* - [bug] Fixed bug in new "autoload_replace" flagMike Bayer2012-02-121-1/+13
| | | | | | which would fail to preserve the primary key constraint of the reflected table. [ticket:2402]
* - [feature] New reflection feature "autoload_replace";Mike Bayer2012-01-281-0/+42
| | | | | | | | | | | | | | | 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]
* - [bug] the "name" of an FK constraint in SQLiteMike Bayer2012-01-071-2/+10
| | | | | | is reflected as "None", not "0" [ticket:2364]. SQLite does not appear to support constraint naming in any case (the names are ignored).
* - [bug] Decode incoming values when retrievingMike Bayer2011-12-061-36/+97
| | | | | | | list of index names and the names of columns within those indexes. [ticket:2269] - rewrite unicode reflection test to be of more general use on broken backends
* - reflection process always resets the primary key constraintMike Bayer2011-12-041-2/+5
| | | | first, fixes extend_existing
* - [feature] The "extend_existing" flag on TableMike Bayer2011-12-041-1/+40
| | | | | | | | | | | | | 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]
* - [bug] Fixed bug whereby "order_by='foreign_key'"Mike Bayer2011-12-011-400/+363
| | | | | | | option to Inspector.get_table_names wasn't implementing the sort properly, replaced with the existing sort algorithm - clean up metadata usage in reflection tests
* - [feature] Added new support for remote "schemas":Mike Bayer2011-10-231-17/+56
| | | | | | | | | | | | | | | | | | | | | | | | - 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]
* some mssql stuff, though unicode is really not working still...Mike Bayer2011-10-161-1/+1
|
* - adjust some tests and such to work better with a mysql 5.5 installMike Bayer2011-10-111-2/+5
| | | | | - Added mysql_length parameter to Index construct, specifies "length" for indexes. [ticket:2293]
* - Narrowed the assumption made when reflectingMike Bayer2011-08-091-0/+1
| | | | | | | | | | a foreign-key referenced table with schema in the current search path; an explicit schema will be applied to the referenced table only if it actually matches that of the referencing table, which also has an explicit schema. Previously it was assumed that "current" schema was synonymous with the full search_path. [ticket:2249]
* ARGMike Bayer2011-06-021-1/+3
|
* - adjust further for unix-style casing, also this is mysql not just mysqldbMike Bayer2011-06-021-1/+2
|
* - Unit tests pass 100% on MySQL installedMike Bayer2011-06-021-10/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | on windows, after aggressive exclusion of a wide variety of tests. Not clear to what degree the failures are related to version 5.5 vs. the usage of windows, in particular the ON UPDATE CASCADE immediately crashes the server. The features being tested here are all edge cases not likely to be used in typical MySQL environments. - Removed the "adjust casing" step that would fail when reflecting a table on MySQL on windows with a mixed case name. After some experimenting with a windows MySQL server, it's been determined that this step wasn't really helping the situation much; MySQL does not return FK names with proper casing on non-windows platforms either, and removing the step at least allows the reflection to act more like it does on other OSes. A warning here has been considered but its difficult to determine under what conditions such a warning can be raised, so punted on that for now - added some docs instead. [ticket:2181] - supports_sane_rowcount will be set to False if using MySQLdb and the DBAPI doesn't provide the constants.CLIENT module.
* - Fixed bug whereby metadata.reflect(bind)Mike Bayer2011-06-011-0/+12
| | | | | would close a Connection passed as a bind argument. Regression from 0.6.
* - The 'useexisting' flag on Table has been supercededMike Bayer2011-04-051-42/+2
| | | | | | | | | | | 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]
* - move all the comments that got shoved below the fixture grabs back upMike Bayer2011-03-271-1/+3
|
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-10/+11
| | | | | | | 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/+3
| | | | | - having occasional issues with BasicEntity grabbing, if it persists may have to pass an explicit base class into setup_classes()/setup_mappers()
* - add tests, CHANGES for [ticket:2095]Mike Bayer2011-03-151-1/+57
|
* Associated was spelled wrong.Michael Trier2011-03-141-1/+1
|
* make it more explicit in tests which dialect we want to use for thingsMike Bayer2011-02-111-0/+1
|
* - new dialect for Drizzle [ticket:2003]Mike Bayer2011-01-261-12/+21
| | | | - move mysqldb to a connector, can be shared among mysql/drizzle
* - whitespace removal bonanzaMike Bayer2011-01-021-48/+48
|
* - sqlalchemy.test and nose plugin moves back to being entirelyMike Bayer2010-11-281-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | outside of "sqlalchemy" and under "test/". Rationale: - coverage plugin works without issue, without need for an awkward additional package install - command line for "nosetests" isn't polluted with SQLAlchemy options [ticket:1949]
| * - move sqlalchemy.test to test.libMike Bayer2010-11-151-3/+3
| |
* | - adapt initial patch from [ticket:1917] to current tipMike Bayer2010-11-161-0/+1
|/ | | | - raise TypeError for immutability
* - added "views=True" option to metadata.reflect(),Mike Bayer2010-10-021-9/+31
| | | | | will add the list of available views to those being reflected. [ticket:1936]
* - *Major* cleanup / modernization of the InformixMike Bayer2010-10-011-4/+4
| | | | | dialect for 0.6, courtesy Florian Apolloner. [ticket:1906]
* - Fixed bug whereby replacing composite foreign keyMike Bayer2010-08-041-2/+40
| | | | | | | | columns in a reflected table would cause an attempt to remove the reflected constraint from the table a second time, raising a KeyError. [ticket:1865] - fixed test of error message now that we've improved it (didn't know that msg had an assertion)
* Python-tidy test/engine and test/aaa_profiling, 80% auto + 20% manual ↵Mike Bayer2010-07-111-215/+285
| | | | intervention
* - Inspector hits bind.connect() when invoked to ensureMike Bayer2010-06-111-0/+6
| | | | | initialize has been called. the internal name ".conn" is changed to ".bind", since that's what it is.
* - Added get_pk_constraint() to reflection.Inspector, similarMike Bayer2010-04-151-6/+13
| | | | | | | | to get_primary_keys() except returns a dict that includes the name of the constraint, for supported backends (PG so far). [ticket:1769] - Postgresql reflects the name of primary key constraints, if one exists. [ticket:1769]