MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / get_plugin_class

Method get_plugin_class

lib/sqlalchemy/sql/base.py:792–811  ·  view source on GitHub ↗
(
        cls, statement: Executable
    )

Source from the content-addressed store, hash-verified

790
791 @classmethod
792 def get_plugin_class(
793 cls, statement: Executable
794 ) -> Optional[Type[CompileState]]:
795 plugin_name = statement._propagate_attrs.get(
796 "compile_state_plugin", None
797 )
798
799 if plugin_name:
800 key = (plugin_name, statement._effective_plugin_target)
801 if key in cls.plugins:
802 return cls.plugins[key]
803
804 # there's no case where we call upon get_plugin_class() and want
805 # to get None back, there should always be a default. return that
806 # if there was no plugin-specific class (e.g. Insert with "orm"
807 # plugin)
808 try:
809 return cls.plugins[("default", statement._effective_plugin_target)]
810 except KeyError:
811 return None
812
813 @classmethod
814 def _get_plugin_class_for_plugin(

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected