class documentation

Represent a SQL identifier combined with quoting preferences. :class:`.quoted_name` is a Python unicode/str subclass which represents a particular identifier name along with a ``quote`` flag. This ``quote`` flag, when set to ``True`` or ``False``, overrides automatic quoting behavior for this identifier in order to either unconditionally quote or to not quote the name. If left at its default of ``None``, quoting behavior is applied to the identifier on a per-backend basis based on an examination of the token itself. A :class:`.quoted_name` object with ``quote=True`` is also prevented from being modified in the case of a so-called "name normalize" option. Certain database backends, such as Oracle, Firebird, and DB2 "normalize" case-insensitive names as uppercase. The SQLAlchemy dialects for these backends convert from SQLAlchemy's lower-case-means-insensitive convention to the upper-case-means-insensitive conventions of those backends. The ``quote=True`` flag here will prevent this conversion from occurring to support an identifier that's quoted as all lower case against such a backend. The :class:`.quoted_name` object is normally created automatically when specifying the name for key schema constructs such as :class:`_schema.Table`, :class:`_schema.Column`, and others. The class can also be passed explicitly as the name to any function that receives a name which can be quoted. Such as to use the :meth:`_engine.Engine.has_table` method with an unconditionally quoted name:: from sqlalchemy import create_engine from sqlalchemy import inspect from sqlalchemy.sql import quoted_name engine = create_engine("oracle+cx_oracle://some_dsn") print(inspect(engine).has_table(quoted_name("some_table", True))) The above logic will run the "has table" logic against the Oracle backend, passing the name exactly as ``"some_table"`` without converting to upper case. .. versionadded:: 0.9.0 .. versionchanged:: 1.2 The :class:`.quoted_name` construct is now importable from ``sqlalchemy.sql``, in addition to the previous location of ``sqlalchemy.sql.elements``.

Class Method construct Undocumented
Method __new__ Undocumented
Method __reduce__ Undocumented
Class Variable __slots__ Undocumented
Instance Variable quote Undocumented
Method _memoized_method_lower Undocumented
Method _memoized_method_upper Undocumented

Inherited from MemoizedSlots:

Method __getattr__ Undocumented
Method _fallback_getattr Undocumented
@overload
@classmethod
def construct(cls, value: str, quote: Optional[bool]) -> quoted_name:
@overload
@classmethod
def construct(cls, value: None, quote: Optional[bool]):
@classmethod
(source)

Undocumented

def __new__(cls, value: str, quote: Optional[bool]) -> quoted_name: (source)

Undocumented

def __reduce__(self): (source)

Undocumented

Undocumented

def _memoized_method_lower(self): (source)

Undocumented

def _memoized_method_upper(self): (source)

Undocumented