MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _get_entrypoint

Method _get_entrypoint

lib/sqlalchemy/engine/url.py:761–783  ·  view source on GitHub ↗

Return the "entry point" dialect class. This is normally the dialect itself except in the case when the returned class implements the get_dialect_cls() method.

(self)

Source from the content-addressed store, hash-verified

759 return u, loaded_plugins, kwargs
760
761 def _get_entrypoint(self) -> Type[Dialect]:
762 """Return the "entry point" dialect class.
763
764 This is normally the dialect itself except in the case when the
765 returned class implements the get_dialect_cls() method.
766
767 """
768 if "+" not in self.drivername:
769 name = self.drivername
770 else:
771 name = self.drivername.replace("+", ".")
772 cls = registry.load(name)
773 # check for legacy dialects that
774 # would return a module with 'dialect' as the
775 # actual class
776 if (
777 hasattr(cls, "dialect")
778 and isinstance(cls.dialect, type)
779 and issubclass(cls.dialect, Dialect)
780 ):
781 return cls.dialect
782 else:
783 return cast("Type[Dialect]", cls)
784
785 def get_dialect(self, _is_async: bool = False) -> Type[Dialect]:
786 """Return the SQLAlchemy :class:`_engine.Dialect` class corresponding

Callers 3

get_dialectMethod · 0.95
create_engineFunction · 0.45
is_preferred_driverFunction · 0.45

Calls 3

castFunction · 0.50
replaceMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected