class IdentifierPreparer: (source)
Known subclasses: sqlalchemy.dialects.mssql.base.MSIdentifierPreparer
, sqlalchemy.dialects.mysql.base.MySQLIdentifierPreparer
, sqlalchemy.dialects.oracle.base.OracleIdentifierPreparer
, sqlalchemy.dialects.postgresql.base.PGIdentifierPreparer
, sqlalchemy.dialects.sqlite.base.SQLiteIdentifierPreparer
Handle quoting and case-folding of identifiers based on options.
Method | __init__ |
Construct a new ``IdentifierPreparer`` object. |
Method | format |
Undocumented |
Method | format |
Undocumented |
Method | format |
Prepare a quoted column name. |
Method | format |
Undocumented |
Method | format |
Undocumented |
Method | format |
Undocumented |
Method | format |
Prepare a quoted column name. |
Method | format |
Undocumented |
Method | format |
Prepare a quoted schema name. |
Method | format |
Undocumented |
Method | format |
Prepare a quoted table and schema name. |
Method | format |
Format table name and schema as a tuple. |
Method | quote |
Conditionally quote an identifier. |
Method | quote |
Quote an identifier. |
Method | quote |
Conditionally quote a schema name. |
Method | truncate |
Undocumented |
Method | truncate |
Undocumented |
Method | unformat |
Unpack 'schema.table.column'-like strings into components. |
Method | validate |
keyword sequence filter. |
Class Variable | schema |
Return the .schema attribute for an object. |
Instance Variable | dialect |
Undocumented |
Instance Variable | escape |
Undocumented |
Instance Variable | escape |
Undocumented |
Instance Variable | final |
Undocumented |
Instance Variable | initial |
Undocumented |
Instance Variable | omit |
Undocumented |
Instance Variable | quote |
Undocumented |
Method | _escape |
Escape an identifier. |
Method | _render |
Undocumented |
Method | _requires |
Return True if the given identifier requires quoting. |
Method | _requires |
Return True if the given identifier requires quoting, but not taking case convention into account. |
Method | _truncate |
Undocumented |
Method | _unescape |
Canonicalize an escaped identifier. |
Method | _with |
Undocumented |
Instance Variable | _double |
Undocumented |
Instance Variable | _strings |
Undocumented |
Property | _r |
Undocumented |
sqlalchemy.dialects.mssql.base.MSIdentifierPreparer
, sqlalchemy.dialects.mysql.base.MySQLIdentifierPreparer
, sqlalchemy.dialects.postgresql.pg8000.PGIdentifierPreparer_pg8000
Construct a new ``IdentifierPreparer`` object. initial_quote Character that begins a delimited identifier. final_quote Character that ends a delimited identifier. Defaults to `initial_quote`. omit_schema Prevent prepending schema name. Useful for databases that do not support schemae.
Optional[ AliasedReturnsRows]
, name: Optional[ str]
= None) -> str
:
(source)
¶
Undocumented
Prepare a quoted column name.
def format_constraint(self, constraint, _alembic_quote=True): (source) ¶
Undocumented
Conditionally quote an identifier. The identifier is quoted if it is a reserved word, contains quote-necessary characters, or is an instance of :class:`.quoted_name` which includes ``quote`` set to ``True``. Subclasses can override this to provide database-dependent quoting behavior for identifier names. :param ident: string identifier :param force: unused .. deprecated:: 0.9 The :paramref:`.IdentifierPreparer.quote.force` parameter is deprecated and will be removed in a future release. This flag has no effect on the behavior of the :meth:`.IdentifierPreparer.quote` method; please refer to :class:`.quoted_name`.
Quote an identifier. Subclasses should override this to provide database-dependent quoting behavior.
sqlalchemy.dialects.mssql.base.MSIdentifierPreparer
Conditionally quote a schema name. The name is quoted if it is a reserved word, contains quote-necessary characters, or is an instance of :class:`.quoted_name` which includes ``quote`` set to ``True``. Subclasses can override this to provide database-dependent quoting behavior for schema names. :param schema: string schema name :param force: unused .. deprecated:: 0.9 The :paramref:`.IdentifierPreparer.quote_schema.force` parameter is deprecated and will be removed in a future release. This flag has no effect on the behavior of the :meth:`.IdentifierPreparer.quote` method; please refer to :class:`.quoted_name`.
keyword sequence filter. a filter for elements that are intended to represent keyword sequences, such as "INITIALLY", "INITIALLY DEFERRED", etc. no special characters should be present. .. versionadded:: 1.3
Return the .schema attribute for an object. For the default IdentifierPreparer, the schema for an object is always the value of the ".schema" attribute. if the preparer is replaced with one that has a non-empty schema_translate_map, the value of the ".schema" attribute is rendered a symbol that will be converted to a real schema name from the mapping post-compile.
sqlalchemy.dialects.mssql.base.MSIdentifierPreparer
, sqlalchemy.dialects.mysql.mysqlconnector.MySQLIdentifierPreparer_mysqlconnector
Escape an identifier. Subclasses should override this to provide database-dependent escaping behavior.
sqlalchemy.dialects.mssql.base.MSIdentifierPreparer
Canonicalize an escaped identifier. Subclasses should override this to provide database-dependent unescaping behavior that reverses _escape_identifier.