summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/reflection.py
Commit message (Collapse)AuthorAgeFilesLines
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - restate sort_tables in terms of a more fine grainedMike Bayer2015-01-011-1/+68
| | | | | | | | | | | | | sort_tables_and_constraints function. - The DDL generation system of :meth:`.MetaData.create_all` and :meth:`.Metadata.drop_all` has been enhanced to in most cases automatically handle the case of mutually dependent foreign key constraints; the need for the :paramref:`.ForeignKeyConstraint.use_alter` flag is greatly reduced. The system also works for constraints which aren't given a name up front; only in the case of DROP is a name required for at least one of the constraints involved in the cycle. fixes #3282
* - document / work around that dialect_options isn't necessarily thereMike Bayer2014-12-051-1/+4
|
* - New Oracle DDL features for tables, indexes: COMPRESS, BITMAP.Mike Bayer2014-12-041-1/+9
| | | | | Patch courtesy Gabor Gombas. fixes #3127
* - use provide_metadata for new unique constraint / index testsMike Bayer2014-10-041-1/+14
| | | | | | | | | | | | | | - add a test for PG reflection of unique index without any unique constraint - for PG, don't include 'duplicates_constraint' in the entry if the index does not actually mirror a constraint - use a distinct method for unique constraint reflection within table - catch unique constraint not implemented condition; this may be within some dialects and also is expected to be supported by Alembic tests - migration + changelogs for #3184 - add individual doc notes as well to MySQL, Postgreql fixes #3184
* Merge branch 'reflect-unique-constraints' of ↵Mike Bayer2014-10-041-0/+34
|\ | | | | | | https://bitbucket.org/jerdfelt/sqlalchemy into pr30
| * Reflect unique constraints when reflecting a Table objectJohannes Erdfelt2014-09-171-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to reflect a table did not create any UniqueConstraint objects. The reflection core made no calls to get_unique_constraints and as a result, the sqlite dialect would never reflect any unique constraints. MySQL transparently converts unique constraints into unique indexes, but SQLAlchemy would reflect those as an Index object and as a UniqueConstraint. The reflection core will now deduplicate the unique constraints. PostgreSQL would reflect unique constraints as an Index object and as a UniqueConstraint object. The reflection core will now deduplicate the unique indexes.
* | - cyclomatic complexity; break up reflecttable(), goes from E to BMike Bayer2014-09-271-39/+74
|/
* - Added :meth:`.Inspector.get_temp_table_names` andMike Bayer2014-09-171-0/+24
| | | | | | | | | | | | :meth:`.Inspector.get_temp_view_names`; currently, only the SQLite dialect supports these methods. The return of temporary table and view names has been **removed** from SQLite's version of :meth:`.Inspector.get_table_names` and :meth:`.Inspector.get_view_names`; other database backends cannot support this information (such as MySQL), and the scope of operation is different in that the tables can be local to a session and typically aren't supported in remote schemas. fixes #3204
* - An adjustment to table/index reflection such that if an indexMike Bayer2014-09-021-8/+17
| | | | | | | reports a column that isn't found to be present in the table, a warning is emitted and the column is skipped. This can occur for some special system column situations as has been observed with Oracle. fixes #3180
* PEP8 style fixesBrian Jarrett2014-07-131-34/+38
|
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* Documentation fix-up: "its" vs. "it's"pr/91Matthias Urlichs2014-05-111-1/+1
| | | | | | | | | Removed ungrammatical apostrophes from documentation, replacing "it's" with "its" where appropriate (but in a few cases with "it is" when that read better). While doing that, I also fixed a couple of minor typos etc. as I noticed them.
* - further refine this so that the ordering of columns is maintained asMike Bayer2014-01-201-8/+1
| | | | | sent to the primary key constraint; existing tests in the PG dialect confirm this.
* - simplify the mechanics of PrimaryKeyConstraint with regards to reflection;Mike Bayer2014-01-201-10/+15
| | | | | | | | | | | | reflection now updates the PKC in place. - support the use case of the empty PrimaryKeyConstraint in order to specify constraint options; the columns marked as primary_key=True will now be gathered into the columns collection, rather than being ignored. [ticket:2910] - add validation such that column specification should only take place in the PrimaryKeyConstraint directly, or by using primary_key=True flags; if both are present, they have to match exactly, otherwise the condition is assumed to be ambiguous, and a warning is emitted; the old behavior of using the PKC columns only is maintained.
* - some test fixesMike Bayer2014-01-191-26/+23
| | | | - clean up some shenanigans in reflection
* - implement kwarg validation and type system for dialect-specificMike Bayer2014-01-181-1/+1
| | | | | arguments; [ticket:2866] - add dialect specific kwarg functionality to ForeignKeyConstraint, ForeignKey
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - reflection of unique constraints backported to 0.8.4 [ticket:1443]Mike Bayer2013-12-031-1/+1
|
* - remove informix dialect, moved out to ↵Mike Bayer2013-11-171-1/+1
| | | | | | https://bitbucket.org/zzzeek/sqlalchemy_informixdb - remove informix, maxdb, access symbols from tests etc.
* Fix cross referencespr/44Vraj Mohan2013-11-141-1/+1
|
* #2183: Metadata.reflect() foreign keys include options when the dialect ↵ijl2013-10-131-1/+6
| | | | exposes it
* plus some more adjustments for mysql, or in general if an Index refers toMike Bayer2013-08-281-1/+9
| | | | in-python only cols
* Fixed bug where using the ``column_reflect`` event to change the ``.key``Mike Bayer2013-08-281-6/+17
| | | | | | of the incoming :class:`.Column` would prevent primary key constraints, indexes, and foreign key constraints from being correctly reflected. Also in 0.8.3. [ticket:2811]
* - A rework to the way that "quoted" identifiers are handled, in thatMike Bayer2013-08-271-1/+48
| | | | | | | | | | | | | | | | 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]
* - A large refactoring of the ``sqlalchemy.sql`` package has reorganizedMike Bayer2013-08-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* these notes about **kw are incorrect, we are talking about the return value hereMike Bayer2013-06-091-8/+0
|
* - get_unique_constraints() pull requestMike Bayer2013-06-091-0/+2
| | | | | | - version (0.9 for now) - changelog - move the test into the test suite so that all dialects can take advantage of it
* Add basic support of unique constraints reflectionpr/4Roman Podolyaka2013-06-091-0/+20
| | | | | | | | | | | | 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.
* do a sweep of some obvious 3kismsMike Bayer2013-05-261-6/+5
|
* that's all of engineMike Bayer2013-05-041-2/+6
|
* - the raw 2to3 runMike Bayer2013-04-271-9/+9
| | | | - went through examples/ and cleaned out excess list() calls
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* fixing broken links (see #2625)Diana Clarke2012-12-051-8/+8
|
* just a pep8 pass of lib/sqlalchemy/engine/Diana Clarke2012-11-191-18/+30
|
* - fix the fixture here that wasn't creating consistentlyMike Bayer2012-10-011-9/+24
| | | | | | | - 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] Adjusted column default reflection code toMike Bayer2012-09-231-1/+1
| | | | | | | | convert non-string values to string, to accommodate old SQLite versions that don't deliver default info as a string. [ticket:2265] - factor sqlite column reflection to be like we did for postgresql, in a separate method.
* - update engine docstrings due to moveMike Bayer2012-08-131-4/+4
| | | | - struggle with Operators class autodoc
* more import cleanupsMike Bayer2012-08-071-9/+8
|
* - document the inspection systemMike Bayer2012-07-181-16/+23
|
* - [feature] The "deferred declarativeMike Bayer2012-05-171-0/+3
| | | | | | | | | | | | | | | | 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-14/+11
|\ | | | | | | | | | | | | | | 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-6/+8
| | | | | | | | - 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-1/+6
|/
* - [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]
* - [feature] New reflection feature "autoload_replace";Mike Bayer2012-01-281-1/+3
| | | | | | | | | | | | | | | 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
|
* - [bug] Fixed bug whereby "order_by='foreign_key'"Mike Bayer2011-12-011-17/+10
| | | | | | | 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
* - Unit tests pass 100% on MySQL installedMike Bayer2011-06-021-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.