summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/reflection.py
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* - metadata.reflect() and reflection.Inspector()Mike Bayer2011-04-231-4/+5
| | | | | | 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
* initial work on column reflectMike Bayer2011-03-141-4/+5
|
* - getting slightly more consistent behavior for the edge case of pk columnsMike Bayer2011-01-151-1/+5
| | | | | | with server default - autoincrement is now false with any server_default, so these all return None, applies consistency to [ticket:2020], [ticket:2021]. if prefetch is desired a "default" should be used instead of server_default.
* - whitespace removal bonanzaMike Bayer2011-01-021-27/+27
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-0/+6
| | | | | a consistent tag - AUTHORS file
* fixupMike Bayer2010-09-051-7/+7
|
* fix variable nameMike Bayer2010-06-141-1/+1
|
* - added documentation for Inspector [ticket:1820]Mike Bayer2010-06-131-9/+74
| | | | | - fixed "toplevel" regexp to include tokens of the form foo-bar-toplevel (i.e. multiple dashes) - some CSS adjustment so that all API headings are in gray.
* - Inspector hits bind.connect() when invoked to ensureMike Bayer2010-06-111-19/+24
| | | | | initialize has been called. the internal name ".conn" is changed to ".bind", since that's what it is.
* holy python2.4 batmanMike Bayer2010-04-151-4/+4
|
* - Added get_pk_constraint() to reflection.Inspector, similarMike Bayer2010-04-151-6/+31
| | | | | | | | 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]
* - oracle + firebird: "case sensitivity" feature will detect an all-lowercaseMike Bayer2010-01-241-1/+3
| | | | | | case-sensitive column name during reflect and add "quote=True" to the generated Column, so that proper quoting is maintained.
* - have inspector properly return default_schema_name [ticket:1626]Mike Bayer2010-01-031-1/+1
|
* Removed references to sequence in MSSQLMichael Trier2009-10-221-1/+1
| | | | | | | Implicit identities in mssql work the same as implicit sequences on any other dialects. Explicit sequences are enabled through the use of "default=Sequence()". See the MSSQL dialect documentation for more information.
* - boolean, int, and float arguments count as "cache key" values for ↵Mike Bayer2009-10-011-3/+10
| | | | | | inspector info_cache() - added awareness of sqlite implicit auto indexes [ticket:1551]
* merge 0.6 series to trunk.Mike Bayer2009-08-061-0/+361