sqlcompyre.analysis.dialects package

Submodules

Module contents

class sqlcompyre.analysis.dialects.DialectProtocol(*args, **kwargs)[source]

Bases: Protocol

This class is to be used to ensure that a dialect implements all required methods & functionality to work within SQLCompyre.

A dialect is essentially a collection of database-related functions that differ between database management systems. TableComparison and SchemaComparison delegate all operations where SQLAlchemy cannot sensibly abstract the underlying database system to dialects. We make extended use of sqlalchemy’s default dialects and extend them whenever possible.

To ensure that all our extensions follow the same interface (and to get better IDE support) we therefore also implement this Protocol.

Methods

get_table_creation_timestamps(engine, tables)

Obtain the creation timestamps from a list of tables.

case_insensitive_collation: str

Case-insensitive collation to use for string comparisons.

case_sensitive_collation: str

Case-sensitive collation to use for string comparisons.

get_table_creation_timestamps(engine: Engine, tables: list[Table]) list[datetime][source]

Obtain the creation timestamps from a list of tables.

Args:
engine: The engine to use for connecting to the database and querying creation

timestamps.

tables: The list of tables to query the creation dates for.

Returns:

The creation timestamps of the tables given to this method, ordered in the same way as the input.

name: str

A unique identifier of the dialect, taken from SQLAlchemy.

supports_multi_part_schemas: bool

Whether the database supports multi-part schemas, i.e. queries across databases.

supports_schemas: bool

Whether the database has a concept of schemas.

verbose_name: str

The common name of the dialect.

views_support_notnull_columns: bool

Whether views have a notion of NOT NULL columns.