Skip to content

Commit 5c4b5c9

Browse files
committed
docs: clarify event listener scoping rationale in dialect
Explain why global Table listener with dialect guard is the standard pattern used by 3rd-party SQLAlchemy dialects (sqlalchemy-exasol, sqlalchemy-bigquery).
1 parent cd474a4 commit 5c4b5c9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/sqlalchemy_excel/dialect.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ def _after_drop(
7777
excel_dbapi.remove_table_metadata(raw_conn, target.name)
7878

7979

80-
# Register DDL events globally for all Table objects
80+
# Register DDL events on the Table class.
81+
#
82+
# This is the standard pattern for third-party SQLAlchemy dialects that need
83+
# post-DDL hooks (cf. sqlalchemy-exasol, sqlalchemy-bigquery). The listeners
84+
# guard on connection.dialect.name so they are a no-op for every non-Excel
85+
# engine in the process. propagate=False prevents inheritance propagation.
8186
event.listen(Table, "after_create", _after_create, propagate=False)
8287
event.listen(Table, "after_drop", _after_drop, propagate=False)
8388

0 commit comments

Comments
 (0)