Understanding registry.register()

158 views
Skip to first unread message

Terrence Brannon

unread,
Dec 10, 2019, 5:02:53 PM12/10/19
to sqlalchemy-devel
hello, I am trying to understand the following code from sqlalchemy-drill:

from sqlalchemy.dialects import registry
registry.register("drill", "sqlalchemy_drill.sadrill", "DrillDialect_sadrill")
registry.register("drill.sadrill", "sqlalchemy_drill.sadrill", "DrillDialect_sadrill")
registry.register("drill.jdbc", "sqlalchemy_drill.jdbc", "DrillDialect_jdbc")

and in looking over sqlalchemy.dialects one can see that registry is an instance of util.PluginLoader:

registry = util.PluginLoader("sqlalchemy.dialects", auto_fn=_auto_fn)
However, none of that makes it clear to me what the 3 arguments to .register() above represent.

If there is documentation on this subject, I would appreciate being pointed to it.

If there is documentation in the code on this subject please point me to it and accept my apologies.


Mike Bayer

unread,
Dec 10, 2019, 5:07:34 PM12/10/19
to 'Terrence Brannon' via sqlalchemy-devel

the drill dialect shouldn't have to have that registry logic in their __init__.py, it's documented as being used for the test suite in conftest.py.   see the above document for guidelines.







--
You received this message because you are subscribed to the Google Groups "sqlalchemy-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy-dev...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages