diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/build/changelog/changelog_09.rst | 22 | ||||
| -rw-r--r-- | doc/build/changelog/migration_09.rst | 28 | ||||
| -rw-r--r-- | doc/build/core/metadata.rst | 5 | ||||
| -rw-r--r-- | doc/build/core/reflection.rst | 4 | ||||
| -rw-r--r-- | doc/build/core/sqlelement.rst | 2 |
5 files changed, 59 insertions, 2 deletions
diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst index be7a7fc7c..b0492e897 100644 --- a/doc/build/changelog/changelog_09.rst +++ b/doc/build/changelog/changelog_09.rst @@ -7,6 +7,28 @@ :version: 0.9.0 .. change:: + :tags: bug, sql + :tickets: 2812 + + A rework to the way that "quoted" identifiers are handled, in that + 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. + + .. seealso:: + + :ref:`change_2812` + + .. change:: :tags: feature, orm :tickets: 2793 diff --git a/doc/build/changelog/migration_09.rst b/doc/build/changelog/migration_09.rst index b8328ce7b..82314cce4 100644 --- a/doc/build/changelog/migration_09.rst +++ b/doc/build/changelog/migration_09.rst @@ -292,6 +292,34 @@ against ``b_value`` directly. :ticket:`2751` +.. _change_2812: + +Schema identifiers now carry along their own quoting information +--------------------------------------------------------------------- + +This change simplifies the Core's usage of so-called "quote" flags, such +as the ``quote`` flag passed to :class:`.Table` and :class:`.Column`. The flag +is now internalized within the string name itself, which is now represented +as an instance of :class:`.quoted_name`, a string subclass. The +:class:`.IdentifierPreparer` now relies solely on the quoting preferences +reported by the :class:`.quoted_name` object rather than checking for any +explicit ``quote`` flags in most cases. The issue resolved here includes +that various case-sensitive methods such as :meth:`.Engine.has_table` as well +as similar methods within dialects now function with explicitly quoted names, +without the need to complicate or introduce backwards-incompatible changes +to those APIs (many of which are 3rd party) with the details of quoting flags - +in particular, a wider range of identifiers now function correctly with the +so-called "uppercase" backends like Oracle, Firebird, and DB2 (backends that +store and report upon table and column names using all uppercase for case +insensitive names). + +The :class:`.quoted_name` object is used internally as needed; however if +other keywords require fixed quoting preferences, the class is available +publically. + +:ticket:`2812` + + New Features ============ diff --git a/doc/build/core/metadata.rst b/doc/build/core/metadata.rst index e4b50f63a..d6fc8c6af 100644 --- a/doc/build/core/metadata.rst +++ b/doc/build/core/metadata.rst @@ -1,12 +1,15 @@ .. _metadata_toplevel: + .. _metadata_describing_toplevel: + .. _metadata_describing: -.. module:: sqlalchemy.schema ================================== Describing Databases with MetaData ================================== +.. module:: sqlalchemy.schema + This section discusses the fundamental :class:`.Table`, :class:`.Column` and :class:`.MetaData` objects. diff --git a/doc/build/core/reflection.rst b/doc/build/core/reflection.rst index 17ff0b99e..2e9a2de64 100644 --- a/doc/build/core/reflection.rst +++ b/doc/build/core/reflection.rst @@ -112,6 +112,8 @@ object's dictionary of tables:: for table in reversed(meta.sorted_tables): someengine.execute(table.delete()) +.. _metadata_reflection_inspector: + Fine Grained Reflection with Inspector -------------------------------------- @@ -128,5 +130,5 @@ database is also available. This is known as the "Inspector":: .. autoclass:: sqlalchemy.engine.reflection.Inspector :members: :undoc-members: - + diff --git a/doc/build/core/sqlelement.rst b/doc/build/core/sqlelement.rst index 953f48c98..0676f18d0 100644 --- a/doc/build/core/sqlelement.rst +++ b/doc/build/core/sqlelement.rst @@ -105,6 +105,8 @@ used to construct any kind of typed SQL expression. :members: :special-members: +.. autoclass:: sqlalchemy.sql.elements.quoted_name + .. autoclass:: UnaryExpression :members: |
