class documentation

Default implementation of Dialect

Class Method get_pool_class Undocumented
Class Method load_provisioning set up the provision.py module for this dialect.
Method __init__ Undocumented
Method connect Establish a connection using this dialect's DBAPI.
Method create_connect_args Build DB-API compatible connection arguments.
Method create_xid Create a random two-phase transaction ID.
Method denormalize_name convert the given name to a case insensitive identifier for the backend if it is an all-lowercase name.
Method do_begin Provide an implementation of ``connection.begin()``, given a DB-API connection.
Method do_close Provide an implementation of ``connection.close()``, given a DBAPI connection.
Method do_commit Provide an implementation of ``connection.commit()``, given a DB-API connection.
Method do_execute Provide an implementation of ``cursor.execute(statement, parameters)``.
Method do_execute_no_params Provide an implementation of ``cursor.execute(statement)``.
Method do_executemany Provide an implementation of ``cursor.executemany(statement, parameters)``.
Method do_ping ping the DBAPI connection and return True if the connection is usable.
Method do_release_savepoint Release the named savepoint on a connection.
Method do_rollback Provide an implementation of ``connection.rollback()``, given a DB-API connection.
Method do_rollback_to_savepoint Rollback a connection to the named savepoint.
Method do_savepoint Create a savepoint with the given name.
Method do_terminate Provide an implementation of ``connection.close()`` that tries as much as possible to not block, given a DBAPI connection.
Method get_default_isolation_level Given a DBAPI connection, return its isolation level, or a default isolation level if one cannot be retrieved.
Method get_dialect_pool_class return a Pool class to use for a given URL
Method get_driver_connection Returns the connection object as returned by the external driver package.
Method get_multi_check_constraints Return information about check constraints in all tables in the given ``schema``.
Method get_multi_columns Return information about columns in all tables in the given ``schema``.
Method get_multi_foreign_keys Return information about foreign_keys in all tables in the given ``schema``.
Method get_multi_indexes Return information about indexes in in all tables in the given ``schema``.
Method get_multi_pk_constraint Return information about primary key constraints in all tables in the given ``schema``.
Method get_multi_table_comment Return information about the table comment in all tables in the given ``schema``.
Method get_multi_table_options Return a dictionary of options specified when the tables in the given schema were created.
Method get_multi_unique_constraints Return information about unique constraints in all tables in the given ``schema``.
Method has_index Check the existence of a particular index name in the database.
Method has_schema Check the existence of a particular schema name in the database.
Method initialize Called during strategized creation of the dialect with a connection.
Method is_disconnect Return True if the given DB-API error indicates an invalid connection
Method normalize_name convert the given name to lowercase if it is detected as case insensitive.
Method on_connect return a callable which sets up a newly created DBAPI connection.
Method reset_isolation_level Given a DBAPI connection, revert its isolation to the default.
Method set_connection_execution_options Establish execution options for a given connection.
Method set_engine_execution_options Establish execution options for a given engine.
Method type_descriptor Provide a database-specific :class:`.TypeEngine` object, given the generic object which comes from the types module.
Method validate_identifier Undocumented
Class Variable colspecs A dictionary of TypeEngine classes from sqlalchemy.types mapped to subclasses that are specific to the dialect class. This dictionary is class-level only and is not accessed from the dialect instance itself.
Class Variable connection_characteristics Undocumented
Class Variable cte_follows_insert target database, when given a CTE with an INSERT statement, needs the CTE to be below the INSERT
Class Variable default_metavalue_token for INSERT... VALUES (DEFAULT) syntax, the token to put in the parenthesis.
Class Variable default_paramstyle Undocumented
Class Variable default_sequence_base the default value that will be rendered as the "START WITH" portion of a CREATE SEQUENCE DDL statement.
Class Variable delete_executemany_returning dialect supports DELETE..RETURNING with executemany.
Class Variable delete_returning if the dialect supports RETURNING with DELETE
Class Variable delete_returning_multifrom if the dialect supports RETURNING with DELETE..FROM
Class Variable div_is_floordiv target database treats the / division operator as "floor division"
Class Variable engine_config_types a mapping of string keys that can be in an engine config linked to type conversion functions.
Class Variable exclude_set_input_sizes set of DBAPI type objects that should be excluded in automatic cursor.setinputsizes() calls.
Class Variable favor_returning_over_lastrowid for backends that support both a lastrowid and a RETURNING insert strategy, favor RETURNING for simple single-int pk inserts.
Class Variable has_terminate Whether or not this dialect has a separate "terminate" implementation that does not block or require awaiting.
Class Variable include_set_input_sizes set of DBAPI type objects that should be included in automatic cursor.setinputsizes() calls.
Class Variable inline_comments Indicates the dialect supports comment DDL that's inline with the definition of a Table or Column. If False, this implies that ALTER must be used to set table and column comments.
Class Variable insert_null_pk_still_autoincrements Undocumented
Class Variable insert_returning if the dialect supports RETURNING with INSERT
Class Variable insertmanyvalues_max_parameters Alternate to insertmanyvalues_page_size, will additionally limit page size based on number of parameters total in the statement.
Class Variable is_async Whether or not this dialect is intended for asyncio use.
Class Variable isolation_level Undocumented
Class Variable max_constraint_name_length Undocumented
Class Variable max_index_name_length Undocumented
Class Variable name identifying name for the dialect from a DBAPI-neutral point of view (i.e. 'sqlite')
Class Variable non_native_boolean_check_constraint Undocumented
Class Variable postfetch_lastrowid Undocumented
Class Variable preexecute_autoincrement_sequences True if 'implicit' primary key functions must be executed separately in order to get their value, if RETURNING is not used.
Class Variable requires_name_normalize Undocumented
Class Variable sequences_optional If True, indicates if the :paramref:`_schema.Sequence.optional` parameter on the :class:`_schema.Sequence` construct should signal to not generate a CREATE SEQUENCE. Applies only to dialects that support sequences...
Class Variable server_side_cursors deprecated; indicates if the dialect should attempt to use server side cursors by default
Class Variable supports_alter ``True`` if the database supports ``ALTER TABLE`` - used only for generating foreign key constraints in certain circumstances
Class Variable supports_comments Indicates the dialect supports comment DDL on tables and columns.
Class Variable supports_constraint_comments Indicates if the dialect supports comment DDL on constraints.
Class Variable supports_default_metavalue dialect supports INSERT... VALUES (DEFAULT) syntax
Class Variable supports_default_values dialect supports INSERT... DEFAULT VALUES syntax
Class Variable supports_empty_insert dialect supports INSERT () VALUES ()
Class Variable supports_for_update_of Undocumented
Class Variable supports_identity_columns target database supports IDENTITY
Class Variable supports_is_distinct_from Undocumented
Class Variable supports_multivalues_insert Target database supports INSERT...VALUES with multiple value sets, i.e. INSERT INTO table (cols) VALUES (...), (...), (...), ...
Class Variable supports_native_decimal indicates if Decimal objects are handled and returned for precision numeric types, or if floats are returned
Class Variable supports_native_enum Indicates if the dialect supports a native ENUM construct. This will prevent :class:`_types.Enum` from generating a CHECK constraint when that type is used in "native" mode.
Class Variable supports_native_uuid indicates if Python UUID() objects are handled natively by the driver for SQL UUID datatypes.
Class Variable supports_sane_multi_rowcount Indicate whether the dialect properly implements rowcount for ``UPDATE`` and ``DELETE`` statements when executed via executemany.
Class Variable supports_sane_rowcount Indicate whether the dialect properly implements rowcount for ``UPDATE`` and ``DELETE`` statements.
Class Variable supports_schemas Undocumented
Class Variable supports_sequences Indicates if the dialect supports CREATE SEQUENCE or similar.
Class Variable supports_server_side_cursors indicates if the dialect supports server side cursors
Class Variable supports_simple_order_by_label target database supports ORDER BY <labelname>, where <labelname> refers to a label in the columns clause of the SELECT
Class Variable supports_statement_cache indicates if this dialect supports caching.
Class Variable supports_views Undocumented
Class Variable tuple_in_values target database supports tuple IN, i.e. (x, y) IN ((q, p), (r, z))
Class Variable update_executemany_returning dialect supports UPDATE..RETURNING with executemany.
Class Variable update_returning if the dialect supports RETURNING with UPDATE
Class Variable update_returning_multifrom if the dialect supports RETURNING with UPDATE..FROM
Class Variable use_insertmanyvalues_wo_returning if True, and use_insertmanyvalues is also True, INSERT statements that don't include RETURNING will also use "insertmanyvalues".
Instance Variable bind_typing Undocumented
Instance Variable compiler_linting Undocumented
Instance Variable dbapi A reference to the DBAPI module object itself.
Instance Variable default_isolation_level the isolation that is implicitly present on new connections
Instance Variable default_schema_name the name of the default schema. This value is only available for supporting dialects, and is typically populated during the initial connection to the database.
Instance Variable identifier_preparer This element will refer to an instance of :class:`.IdentifierPreparer` once a :class:`.DefaultDialect` has been constructed.
Instance Variable insertmanyvalues_page_size Number of rows to render into an individual INSERT..VALUES() statement for :attr:`.ExecuteStyle.INSERTMANYVALUES` executions.
Instance Variable label_length optional user-defined max length for SQL labels
Instance Variable max_identifier_length The maximum length of identifier names.
Instance Variable paramstyle the paramstyle to be used (some DB-APIs support multiple paramstyles).
Instance Variable positional True if the paramstyle for this Dialect is positional.
Instance Variable server_version_info a tuple containing a version number for the DB backend in use.
Instance Variable supports_native_boolean Indicates if the dialect supports a native boolean construct. This will prevent :class:`_types.Boolean` from generating a CHECK constraint when that type is used.
Instance Variable type_compiler legacy; this is a TypeCompiler class at the class level, a TypeCompiler instance at the instance level.
Instance Variable type_compiler_instance instance of a :class:`.Compiled` class used to compile SQL type objects
Instance Variable use_insertmanyvalues if True, indicates "insertmanyvalues" functionality should be used to allow for ``insert_executemany_returning`` behavior, if possible.
Property dialect_description Undocumented
Property full_returning Undocumented
Property insert_executemany_returning dialect / driver / database supports some means of providing INSERT...RETURNING support when dialect.do_executemany() is used.
Property loaded_dbapi same as .dbapi, but is never None; will raise an error if no DBAPI was set up.
Property supports_sane_rowcount_returning True if this dialect supports sane rowcount even if RETURNING is in use.
Method _assert_and_set_isolation_level Undocumented
Method _builtin_onconnect Undocumented
Method _check_max_identifier_length Perform a connection / server version specific check to determine the max_identifier_length.
Method _default_multi_reflect Undocumented
Method _deliver_insertmanyvalues_batches convert executemany parameters for an INSERT into an iterator of statement/single execute values, used by the insertmanyvalues feature.
Method _do_ping_w_event Undocumented
Method _ensure_has_table_connection Undocumented
Method _gen_allowed_isolation_levels Undocumented
Method _overrides_default Undocumented
Method _reset_characteristics Undocumented
Method _set_connection_characteristics Undocumented
Class Variable _legacy_binary_type_literal_encoding Undocumented
Instance Variable _ischema Undocumented
Instance Variable _on_connect_isolation_level Undocumented
Instance Variable _user_defined_max_identifier_length Undocumented
Property _bind_typing_render_casts Undocumented
Property _dialect_specific_select_one Undocumented
Property _supports_statement_cache internal evaluation for supports_statement_cache
Property _type_memos Undocumented

Inherited from Dialect:

Class Method engine_created A convenience hook called before returning the final :class:`_engine.Engine`.
Class Method get_async_dialect_cls Given a URL, return the :class:`.Dialect` that will be used by an async engine.
Class Method get_dialect_cls Given a URL, return the :class:`.Dialect` that will be used.
Class Method import_dbapi Import the DBAPI module that is used by this dialect.
Method do_begin_twophase Begin a two phase transaction on the given connection.
Method do_commit_twophase Commit a two phase transaction on the given connection.
Method do_prepare_twophase Prepare a two phase transaction on the given connection.
Method do_recover_twophase Recover list of uncommitted prepared two phase transaction identifiers on the given connection.
Method do_rollback_twophase Rollback a two phase transaction on the given connection.
Method do_set_input_sizes invoke the cursor.setinputsizes() method with appropriate arguments
Method get_check_constraints Return information about check constraints in ``table_name``.
Method get_columns Return information about columns in ``table_name``.
Method get_foreign_keys Return information about foreign_keys in ``table_name``.
Method get_indexes Return information about indexes in ``table_name``.
Method get_isolation_level Given a DBAPI connection, return its isolation level.
Method get_isolation_level_values return a sequence of string isolation level names that are accepted by this dialect.
Method get_materialized_view_names Return a list of all materialized view names available in the database.
Method get_pk_constraint Return information about the primary key constraint on table_name`.
Method get_schema_names Return a list of all schema names available in the database.
Method get_sequence_names Return a list of all sequence names available in the database.
Method get_table_comment Return the "comment" for the table identified by ``table_name``.
Method get_table_names Return a list of table names for ``schema``.
Method get_table_options Return a dictionary of options specified when ``table_name`` was created.
Method get_temp_table_names Return a list of temporary table names on the given connection, if supported by the underlying backend.
Method get_temp_view_names Return a list of temporary view names on the given connection, if supported by the underlying backend.
Method get_unique_constraints Return information about unique constraints in ``table_name``.
Method get_view_definition Return plain or materialized view definition.
Method get_view_names Return a list of all non-materialized view names available in the database.
Method has_sequence Check the existence of a particular sequence in the database.
Method has_table For internal dialect use, check the existence of a particular table or view in the database.
Method on_connect_url return a callable which sets up a newly created DBAPI connection.
Method set_isolation_level Given a DBAPI connection, set its isolation level.
Class Variable construct_arguments Optional set of argument specifiers for various SQLAlchemy constructs, typically schema items.
Class Variable ddl_compiler a :class:`.Compiled` class used to compile DDL statements
Class Variable dispatch Undocumented
Class Variable driver identifying name for the dialect's DBAPI
Class Variable execute_sequence_format either the 'tuple' or 'list' type, depending on what cursor.execute() accepts for the second argument (they vary).
Class Variable execution_ctx_cls a :class:`.ExecutionContext` class used to handle statement execution
Class Variable preparer a :class:`.IdentifierPreparer` class used to quote identifiers.
Class Variable reflection_options Sequence of string names indicating keyword arguments that can be established on a :class:`.Table` object which will be passed as "reflection options" when using :paramref:`.Table.autoload_with`.
Class Variable statement_compiler a :class:`.Compiled` class used to compile SQL statements
Class Variable type_compiler_cls a :class:`.Compiled` class used to compile SQL type objects
Method _get_default_schema_name Return the string name of the currently selected schema from the given connection.
Method _get_server_version_info Retrieve the server version info from the given connection.
Class Variable _has_events Undocumented
@classmethod
def load_provisioning(cls): (source)

set up the provision.py module for this dialect. For dialects that include a provision.py module that sets up provisioning followers, this method should initiate that process. A typical implementation would be:: @classmethod def load_provisioning(cls): __import__("mydialect.provision") The default method assumes a module named ``provision.py`` inside the owning package of the current dialect, based on the ``__module__`` attribute:: @classmethod def load_provisioning(cls): package = ".".join(cls.__module__.split(".")[0:-1]) try: __import__(package + ".provision") except ImportError: pass .. versionadded:: 1.3.14

@util.deprecated_params(empty_in_strategy=('1.4', 'The :paramref:`_sa.create_engine.empty_in_strategy` keyword is deprecated, and no longer has any effect. All IN expressions are now rendered using the "expanding parameter" strategy which renders a set of boundexpressions, or an "empty set" SELECT, at statement executiontime.'), server_side_cursors=('1.4', 'The :paramref:`_sa.create_engine.server_side_cursors` parameter is deprecated and will be removed in a future release. Please use the :paramref:`_engine.Connection.execution_options.stream_results` parameter.'))
def __init__(self, paramstyle: Optional[_ParamStyle] = None, isolation_level: Optional[IsolationLevel] = None, dbapi: Optional[ModuleType] = None, implicit_returning: Literal[True] = True, supports_native_boolean: Optional[bool] = None, max_identifier_length: Optional[int] = None, label_length: Optional[int] = None, insertmanyvalues_page_size: Union[_NoArg, int] = _NoArg.NO_ARG, use_insertmanyvalues: Optional[bool] = None, compiler_linting: Linting = int(compiler.NO_LINTING), server_side_cursors: bool = False, **kwargs: Any): (source)
def connect(self, *cargs, **cparams): (source)

Establish a connection using this dialect's DBAPI. The default implementation of this method is:: def connect(self, *cargs, **cparams): return self.dbapi.connect(*cargs, **cparams) The ``*cargs, **cparams`` parameters are generated directly from this dialect's :meth:`.Dialect.create_connect_args` method. This method may be used for dialects that need to perform programmatic per-connection steps when a new connection is procured from the DBAPI. :param \*cargs: positional parameters returned from the :meth:`.Dialect.create_connect_args` method :param \*\*cparams: keyword parameters returned from the :meth:`.Dialect.create_connect_args` method. :return: a DBAPI connection, typically from the :pep:`249` module level ``.connect()`` function. .. seealso:: :meth:`.Dialect.create_connect_args` :meth:`.Dialect.on_connect`

def create_connect_args(self, url): (source)

Build DB-API compatible connection arguments. Given a :class:`.URL` object, returns a tuple consisting of a ``(*args, **kwargs)`` suitable to send directly to the dbapi's connect function. The arguments are sent to the :meth:`.Dialect.connect` method which then runs the DBAPI-level ``connect()`` function. The method typically makes use of the :meth:`.URL.translate_connect_args` method in order to generate a dictionary of options. The default implementation is:: def create_connect_args(self, url): opts = url.translate_connect_args() opts.update(url.query) return [[], opts] :param url: a :class:`.URL` object :return: a tuple of ``(*args, **kwargs)`` which will be passed to the :meth:`.Dialect.connect` method. .. seealso:: :meth:`.URL.translate_connect_args`

def create_xid(self): (source)

Create a random two-phase transaction ID. This id will be passed to do_begin_twophase(), do_rollback_twophase(), do_commit_twophase(). Its format is unspecified.

def denormalize_name(self, name): (source)

convert the given name to a case insensitive identifier for the backend if it is an all-lowercase name. This method is only used if the dialect defines requires_name_normalize=True.

def do_begin(self, dbapi_connection): (source)

Provide an implementation of ``connection.begin()``, given a DB-API connection. The DBAPI has no dedicated "begin" method and it is expected that transactions are implicit. This hook is provided for those DBAPIs that might need additional help in this area. :param dbapi_connection: a DBAPI connection, typically proxied within a :class:`.ConnectionFairy`.

def do_close(self, dbapi_connection): (source)

Provide an implementation of ``connection.close()``, given a DBAPI connection. This hook is called by the :class:`_pool.Pool` when a connection has been detached from the pool, or is being returned beyond the normal capacity of the pool.

def do_commit(self, dbapi_connection): (source)

Provide an implementation of ``connection.commit()``, given a DB-API connection. :param dbapi_connection: a DBAPI connection, typically proxied within a :class:`.ConnectionFairy`.

def do_execute(self, cursor, statement, parameters, context=None): (source)

Provide an implementation of ``cursor.execute(statement, parameters)``.

def do_execute_no_params(self, cursor, statement, context=None): (source)

Provide an implementation of ``cursor.execute(statement)``. The parameter collection should not be sent.

def do_release_savepoint(self, connection, name): (source)

Release the named savepoint on a connection. :param connection: a :class:`_engine.Connection`. :param name: savepoint name.

def do_rollback(self, dbapi_connection): (source)

Provide an implementation of ``connection.rollback()``, given a DB-API connection. :param dbapi_connection: a DBAPI connection, typically proxied within a :class:`.ConnectionFairy`.

def do_rollback_to_savepoint(self, connection, name): (source)

Rollback a connection to the named savepoint. :param connection: a :class:`_engine.Connection`. :param name: savepoint name.

def do_savepoint(self, connection, name): (source)

Create a savepoint with the given name. :param connection: a :class:`_engine.Connection`. :param name: savepoint name.

def do_terminate(self, dbapi_connection): (source)

Provide an implementation of ``connection.close()`` that tries as much as possible to not block, given a DBAPI connection. In the vast majority of cases this just calls .close(), however for some asyncio dialects may call upon different API features. This hook is called by the :class:`_pool.Pool` when a connection is being recycled or has been invalidated. .. versionadded:: 1.4.41

def get_default_isolation_level(self, dbapi_conn): (source)

Given a DBAPI connection, return its isolation level, or a default isolation level if one cannot be retrieved. May be overridden by subclasses in order to provide a "fallback" isolation level for databases that cannot reliably retrieve the actual isolation level. By default, calls the :meth:`_engine.Interfaces.get_isolation_level` method, propagating any exceptions raised. .. versionadded:: 1.3.22

def get_dialect_pool_class(self, url: URL) -> Type[Pool]: (source)

return a Pool class to use for a given URL

def get_driver_connection(self, connection): (source)

Returns the connection object as returned by the external driver package. For normal dialects that use a DBAPI compliant driver this call will just return the ``connection`` passed as argument. For dialects that instead adapt a non DBAPI compliant driver, like when adapting an asyncio driver, this call will return the connection-like object as returned by the driver. .. versionadded:: 1.4.24

def get_multi_check_constraints(self, connection, **kw): (source)

Return information about check constraints in all tables in the given ``schema``. This is an internal dialect method. Applications should use :meth:`.Inspector.get_multi_check_constraints`. .. note:: The :class:`_engine.DefaultDialect` provides a default implementation that will call the single table method for each object returned by :meth:`Dialect.get_table_names`, :meth:`Dialect.get_view_names` or :meth:`Dialect.get_materialized_view_names` depending on the provided ``kind``. Dialects that want to support a faster implementation should implement this method. .. versionadded:: 2.0

def get_multi_columns(self, connection, **kw): (source)

Return information about columns in all tables in the given ``schema``. This is an internal dialect method. Applications should use :meth:`.Inspector.get_multi_columns`. .. note:: The :class:`_engine.DefaultDialect` provides a default implementation that will call the single table method for each object returned by :meth:`Dialect.get_table_names`, :meth:`Dialect.get_view_names` or :meth:`Dialect.get_materialized_view_names` depending on the provided ``kind``. Dialects that want to support a faster implementation should implement this method. .. versionadded:: 2.0

def get_multi_foreign_keys(self, connection, **kw): (source)

Return information about foreign_keys in all tables in the given ``schema``. This is an internal dialect method. Applications should use :meth:`_engine.Inspector.get_multi_foreign_keys`. .. note:: The :class:`_engine.DefaultDialect` provides a default implementation that will call the single table method for each object returned by :meth:`Dialect.get_table_names`, :meth:`Dialect.get_view_names` or :meth:`Dialect.get_materialized_view_names` depending on the provided ``kind``. Dialects that want to support a faster implementation should implement this method. .. versionadded:: 2.0

def get_multi_indexes(self, connection, **kw): (source)

Return information about indexes in in all tables in the given ``schema``. This is an internal dialect method. Applications should use :meth:`.Inspector.get_multi_indexes`. .. note:: The :class:`_engine.DefaultDialect` provides a default implementation that will call the single table method for each object returned by :meth:`Dialect.get_table_names`, :meth:`Dialect.get_view_names` or :meth:`Dialect.get_materialized_view_names` depending on the provided ``kind``. Dialects that want to support a faster implementation should implement this method. .. versionadded:: 2.0

def get_multi_pk_constraint(self, connection, **kw): (source)

Return information about primary key constraints in all tables in the given ``schema``. This is an internal dialect method. Applications should use :meth:`.Inspector.get_multi_pk_constraint`. .. note:: The :class:`_engine.DefaultDialect` provides a default implementation that will call the single table method for each object returned by :meth:`Dialect.get_table_names`, :meth:`Dialect.get_view_names` or :meth:`Dialect.get_materialized_view_names` depending on the provided ``kind``. Dialects that want to support a faster implementation should implement this method. .. versionadded:: 2.0

def get_multi_table_comment(self, connection, **kw): (source)

Return information about the table comment in all tables in the given ``schema``. This is an internal dialect method. Applications should use :meth:`_engine.Inspector.get_multi_table_comment`. .. note:: The :class:`_engine.DefaultDialect` provides a default implementation that will call the single table method for each object returned by :meth:`Dialect.get_table_names`, :meth:`Dialect.get_view_names` or :meth:`Dialect.get_materialized_view_names` depending on the provided ``kind``. Dialects that want to support a faster implementation should implement this method. .. versionadded:: 2.0

def get_multi_table_options(self, connection, **kw): (source)

Return a dictionary of options specified when the tables in the given schema were created. This is an internal dialect method. Applications should use :meth:`_engine.Inspector.get_multi_table_options`. .. note:: The :class:`_engine.DefaultDialect` provides a default implementation that will call the single table method for each object returned by :meth:`Dialect.get_table_names`, :meth:`Dialect.get_view_names` or :meth:`Dialect.get_materialized_view_names` depending on the provided ``kind``. Dialects that want to support a faster implementation should implement this method. .. versionadded:: 2.0

def get_multi_unique_constraints(self, connection, **kw): (source)

Return information about unique constraints in all tables in the given ``schema``. This is an internal dialect method. Applications should use :meth:`.Inspector.get_multi_unique_constraints`. .. note:: The :class:`_engine.DefaultDialect` provides a default implementation that will call the single table method for each object returned by :meth:`Dialect.get_table_names`, :meth:`Dialect.get_view_names` or :meth:`Dialect.get_materialized_view_names` depending on the provided ``kind``. Dialects that want to support a faster implementation should implement this method. .. versionadded:: 2.0

def has_index(self, connection, table_name, index_name, schema=None, **kw): (source)

Check the existence of a particular index name in the database. Given a :class:`_engine.Connection` object, a string ``table_name`` and string index name, return ``True`` if an index of the given name on the given table exists, ``False`` otherwise. The :class:`.DefaultDialect` implements this in terms of the :meth:`.Dialect.has_table` and :meth:`.Dialect.get_indexes` methods, however dialects can implement a more performant version. This is an internal dialect method. Applications should use :meth:`_engine.Inspector.has_index`. .. versionadded:: 1.4

def has_schema(self, connection: Connection, schema_name: str, **kw: Any) -> bool: (source)

Check the existence of a particular schema name in the database. Given a :class:`_engine.Connection` object, a string ``schema_name``, return ``True`` if a schema of the given exists, ``False`` otherwise. The :class:`.DefaultDialect` implements this by checking the presence of ``schema_name`` among the schemas returned by :meth:`.Dialect.get_schema_names`, however dialects can implement a more performant version. This is an internal dialect method. Applications should use :meth:`_engine.Inspector.has_schema`. .. versionadded:: 2.0

def initialize(self, connection): (source)

Called during strategized creation of the dialect with a connection. Allows dialects to configure options based on server version info or other properties. The connection passed here is a SQLAlchemy Connection object, with full capabilities. The initialize() method of the base dialect should be called via super(). .. note:: as of SQLAlchemy 1.4, this method is called **before** any :meth:`_engine.Dialect.on_connect` hooks are called.

def normalize_name(self, name): (source)

convert the given name to lowercase if it is detected as case insensitive. This method is only used if the dialect defines requires_name_normalize=True.

def on_connect(self): (source)

return a callable which sets up a newly created DBAPI connection. The callable should accept a single argument "conn" which is the DBAPI connection itself. The inner callable has no return value. E.g.:: class MyDialect(default.DefaultDialect): # ... def on_connect(self): def do_on_connect(connection): connection.execute("SET SPECIAL FLAGS etc") return do_on_connect This is used to set dialect-wide per-connection options such as isolation modes, Unicode modes, etc. The "do_on_connect" callable is invoked by using the :meth:`_events.PoolEvents.connect` event hook, then unwrapping the DBAPI connection and passing it into the callable. .. versionchanged:: 1.4 the on_connect hook is no longer called twice for the first connection of a dialect. The on_connect hook is still called before the :meth:`_engine.Dialect.initialize` method however. .. versionchanged:: 1.4.3 the on_connect hook is invoked from a new method on_connect_url that passes the URL that was used to create the connect args. Dialects can implement on_connect_url instead of on_connect if they need the URL object that was used for the connection in order to get additional context. If None is returned, no event listener is generated. :return: a callable that accepts a single DBAPI connection as an argument, or None. .. seealso:: :meth:`.Dialect.connect` - allows the DBAPI ``connect()`` sequence itself to be controlled. :meth:`.Dialect.on_connect_url` - supersedes :meth:`.Dialect.on_connect` to also receive the :class:`_engine.URL` object in context.

def reset_isolation_level(self, dbapi_conn): (source)

Given a DBAPI connection, revert its isolation to the default. Note that this is a dialect-level method which is used as part of the implementation of the :class:`_engine.Connection` and :class:`_engine.Engine` isolation level facilities; these APIs should be preferred for most typical use cases. .. seealso:: :meth:`_engine.Connection.get_isolation_level` - view current level :attr:`_engine.Connection.default_isolation_level` - view default level :paramref:`.Connection.execution_options.isolation_level` - set per :class:`_engine.Connection` isolation level :paramref:`_sa.create_engine.isolation_level` - set per :class:`_engine.Engine` isolation level

def set_connection_execution_options(self, connection: Connection, opts: Mapping[str, Any]): (source)

Establish execution options for a given connection. This is implemented by :class:`.DefaultDialect` in order to implement the :paramref:`_engine.Connection.execution_options.isolation_level` execution option. Dialects can intercept various execution options which may need to modify state on a particular DBAPI connection. .. versionadded:: 1.4

def set_engine_execution_options(self, engine: Engine, opts: Mapping[str, Any]): (source)

Establish execution options for a given engine. This is implemented by :class:`.DefaultDialect` to establish event hooks for new :class:`.Connection` instances created by the given :class:`.Engine` which will then invoke the :meth:`.Dialect.set_connection_execution_options` method for that connection.

def type_descriptor(self, typeobj): (source)

Provide a database-specific :class:`.TypeEngine` object, given the generic object which comes from the types module. This method looks for a dictionary called ``colspecs`` as a class or instance-level variable, and passes on to :func:`_types.adapt_type`.

def validate_identifier(self, ident): (source)

Undocumented

connection_characteristics = (source)
cte_follows_insert: bool = (source)

target database, when given a CTE with an INSERT statement, needs the CTE to be below the INSERT

default_metavalue_token: str = (source)

for INSERT... VALUES (DEFAULT) syntax, the token to put in the parenthesis.

default_sequence_base: int = (source)

the default value that will be rendered as the "START WITH" portion of a CREATE SEQUENCE DDL statement.

delete_executemany_returning: bool = (source)
delete_returning_multifrom: bool = (source)

if the dialect supports RETURNING with DELETE..FROM .. versionadded:: 2.0

div_is_floordiv: bool = (source)

target database treats the / division operator as "floor division"

engine_config_types: Mapping[str, Any] = (source)

a mapping of string keys that can be in an engine config linked to type conversion functions.

exclude_set_input_sizes: Optional[Set[Any]] = (source)

set of DBAPI type objects that should be excluded in automatic cursor.setinputsizes() calls. This is only used if bind_typing is BindTyping.SET_INPUT_SIZES

favor_returning_over_lastrowid: bool = (source)

for backends that support both a lastrowid and a RETURNING insert strategy, favor RETURNING for simple single-int pk inserts. cursor.lastrowid tends to be more performant on most backends.

has_terminate: bool = (source)

Whether or not this dialect has a separate "terminate" implementation that does not block or require awaiting.

include_set_input_sizes: Optional[Set[Any]] = (source)

set of DBAPI type objects that should be included in automatic cursor.setinputsizes() calls. This is only used if bind_typing is BindTyping.SET_INPUT_SIZES

inline_comments: bool = (source)

Indicates the dialect supports comment DDL that's inline with the definition of a Table or Column. If False, this implies that ALTER must be used to set table and column comments.

insertmanyvalues_max_parameters: int = (source)

Alternate to insertmanyvalues_page_size, will additionally limit page size based on number of parameters total in the statement.

isolation_level: Optional[str] = (source)

Undocumented

max_constraint_name_length: Optional[int] = (source)

Undocumented

max_index_name_length: Optional[int] = (source)

Undocumented

non_native_boolean_check_constraint: bool = (source)

Undocumented

preexecute_autoincrement_sequences: bool = (source)

True if 'implicit' primary key functions must be executed separately in order to get their value, if RETURNING is not used. This is currently oriented towards PostgreSQL when the ``implicit_returning=False`` parameter is used on a :class:`.Table` object.

requires_name_normalize: bool = (source)
sequences_optional: bool = (source)

If True, indicates if the :paramref:`_schema.Sequence.optional` parameter on the :class:`_schema.Sequence` construct should signal to not generate a CREATE SEQUENCE. Applies only to dialects that support sequences. Currently used only to allow PostgreSQL SERIAL to be used on a column that specifies Sequence() for usage on other backends.

server_side_cursors: bool = (source)

deprecated; indicates if the dialect should attempt to use server side cursors by default

supports_alter: bool = (source)

``True`` if the database supports ``ALTER TABLE`` - used only for generating foreign key constraints in certain circumstances

supports_constraint_comments: bool = (source)

Indicates if the dialect supports comment DDL on constraints. .. versionadded: 2.0

supports_for_update_of: bool = (source)

Undocumented

supports_is_distinct_from: bool = (source)

Undocumented

supports_native_enum: bool = (source)

Indicates if the dialect supports a native ENUM construct. This will prevent :class:`_types.Enum` from generating a CHECK constraint when that type is used in "native" mode.

supports_native_uuid: bool = (source)

indicates if Python UUID() objects are handled natively by the driver for SQL UUID datatypes. .. versionadded:: 2.0

supports_sane_rowcount: bool = (source)
supports_schemas: bool = (source)

Undocumented

supports_simple_order_by_label: bool = (source)

target database supports ORDER BY <labelname>, where <labelname> refers to a label in the columns clause of the SELECT

supports_statement_cache: bool = (source)

indicates if this dialect supports caching. All dialects that are compatible with statement caching should set this flag to True directly on each dialect class and subclass that supports it. SQLAlchemy tests that this flag is locally present on each dialect subclass before it will use statement caching. This is to provide safety for legacy or new dialects that are not yet fully tested to be compliant with SQL statement caching. .. versionadded:: 1.4.5 .. seealso:: :ref:`engine_thirdparty_caching`

supports_views: bool = (source)

Undocumented

tuple_in_values: bool = (source)

target database supports tuple IN, i.e. (x, y) IN ((q, p), (r, z))

update_executemany_returning: bool = (source)
use_insertmanyvalues_wo_returning: bool = (source)

if True, and use_insertmanyvalues is also True, INSERT statements that don't include RETURNING will also use "insertmanyvalues". .. versionadded:: 2.0

bind_typing = (source)

Undocumented

A reference to the DBAPI module object itself. SQLAlchemy dialects import DBAPI modules using the classmethod :meth:`.Dialect.import_dbapi`. The rationale is so that any dialect module can be imported and used to generate SQL statements without the need for the actual DBAPI driver to be installed. Only when an :class:`.Engine` is constructed using :func:`.create_engine` does the DBAPI get imported; at that point, the creation process will assign the DBAPI module to this attribute. Dialects should therefore implement :meth:`.Dialect.import_dbapi` which will import the necessary module and return it, and then refer to ``self.dbapi`` in dialect code in order to refer to the DBAPI module contents. .. versionchanged:: The :attr:`.Dialect.dbapi` attribute is exclusively used as the per-:class:`.Dialect`-instance reference to the DBAPI module. The previous not-fully-documented ``.Dialect.dbapi()`` classmethod is deprecated and replaced by :meth:`.Dialect.import_dbapi`.

default_isolation_level = (source)

the isolation that is implicitly present on new connections

default_schema_name = (source)

the name of the default schema. This value is only available for supporting dialects, and is typically populated during the initial connection to the database.

identifier_preparer = (source)

This element will refer to an instance of :class:`.IdentifierPreparer` once a :class:`.DefaultDialect` has been constructed.

insertmanyvalues_page_size = (source)

Number of rows to render into an individual INSERT..VALUES() statement for :attr:`.ExecuteStyle.INSERTMANYVALUES` executions. The default dialect defaults this to 1000. .. versionadded:: 2.0 .. seealso:: :paramref:`_engine.Connection.execution_options.insertmanyvalues_page_size` - execution option available on :class:`_engine.Connection`, statements

label_length = (source)

optional user-defined max length for SQL labels

paramstyle = (source)

the paramstyle to be used (some DB-APIs support multiple paramstyles).

positional = (source)

True if the paramstyle for this Dialect is positional.

server_version_info = (source)

a tuple containing a version number for the DB backend in use. This value is only available for supporting dialects, and is typically populated during the initial connection to the database.

supports_native_boolean = (source)

Indicates if the dialect supports a native boolean construct. This will prevent :class:`_types.Boolean` from generating a CHECK constraint when that type is used.

type_compiler = (source)

legacy; this is a TypeCompiler class at the class level, a TypeCompiler instance at the instance level. Refer to type_compiler_instance instead.

type_compiler_instance = (source)

instance of a :class:`.Compiled` class used to compile SQL type objects .. versionadded:: 2.0

use_insertmanyvalues = (source)

if True, indicates "insertmanyvalues" functionality should be used to allow for ``insert_executemany_returning`` behavior, if possible. In practice, setting this to True means: if ``supports_multivalues_insert``, ``insert_returning`` and ``use_insertmanyvalues`` are all True, the SQL compiler will produce an INSERT that will be interpreted by the :class:`.DefaultDialect` as an :attr:`.ExecuteStyle.INSERTMANYVALUES` execution that allows for INSERT of many rows with RETURNING by rewriting a single-row INSERT statement to have multiple VALUES clauses, also executing the statement multiple times for a series of batches when large numbers of rows are given. The parameter is False for the default dialect, and is set to True for SQLAlchemy internal dialects SQLite, MySQL/MariaDB, PostgreSQL, SQL Server. It remains at False for Oracle, which provides native "executemany with RETURNING" support and also does not support ``supports_multivalues_insert``. For MySQL/MariaDB, those MySQL dialects that don't support RETURNING will not report ``insert_executemany_returning`` as True. .. versionadded:: 2.0 .. seealso:: :ref:`engine_insertmanyvalues`

@property
@util.deprecated('2.0', 'full_returning is deprecated, please use insert_returning, update_returning, delete_returning')
full_returning = (source)

Undocumented

@property
insert_executemany_returning = (source)

dialect / driver / database supports some means of providing INSERT...RETURNING support when dialect.do_executemany() is used.

@util.memoized_property
loaded_dbapi: ModuleType = (source)

same as .dbapi, but is never None; will raise an error if no DBAPI was set up. .. versionadded:: 2.0

@property
supports_sane_rowcount_returning = (source)

True if this dialect supports sane rowcount even if RETURNING is in use. For dialects that don't support RETURNING, this is synonymous with ``supports_sane_rowcount``.

def _assert_and_set_isolation_level(self, dbapi_conn, level): (source)
def _builtin_onconnect(self) -> Optional[_ListenerFnType]: (source)
def _check_max_identifier_length(self, connection): (source)

Perform a connection / server version specific check to determine the max_identifier_length. If the dialect's class level max_identifier_length should be used, can return None. .. versionadded:: 1.3.9

def _default_multi_reflect(self, single_tbl_method, connection, kind, schema, filter_names, scope, **kw): (source)

Undocumented

def _deliver_insertmanyvalues_batches(self, cursor, statement, parameters, generic_setinputsizes, context): (source)

convert executemany parameters for an INSERT into an iterator of statement/single execute values, used by the insertmanyvalues feature.

def _do_ping_w_event(self, dbapi_connection: DBAPIConnection) -> bool: (source)
def _ensure_has_table_connection(self, arg): (source)

Undocumented

@util.memoized_instancemethod
def _gen_allowed_isolation_levels(self, dbapi_conn): (source)

Undocumented

def _overrides_default(self, method): (source)
def _reset_characteristics(self, characteristics, dbapi_connection): (source)

Undocumented

def _set_connection_characteristics(self, connection, characteristics): (source)

Undocumented

_legacy_binary_type_literal_encoding: str = (source)

Undocumented

_ischema = (source)

Undocumented

_user_defined_max_identifier_length = (source)

Undocumented

@util.memoized_property
_bind_typing_render_casts = (source)
@util.memoized_property
_supports_statement_cache = (source)

internal evaluation for supports_statement_cache

@util.memoized_property
_type_memos = (source)