| 778 | |
| 779 | @classmethod |
| 780 | def get_plugin_class( |
| 781 | cls, statement: Executable |
| 782 | ) -> Optional[Type[CompileState]]: |
| 783 | plugin_name = statement._propagate_attrs.get( |
| 784 | "compile_state_plugin", None |
| 785 | ) |
| 786 | |
| 787 | if plugin_name: |
| 788 | key = (plugin_name, statement._effective_plugin_target) |
| 789 | if key in cls.plugins: |
| 790 | return cls.plugins[key] |
| 791 | |
| 792 | # there's no case where we call upon get_plugin_class() and want |
| 793 | # to get None back, there should always be a default. return that |
| 794 | # if there was no plugin-specific class (e.g. Insert with "orm" |
| 795 | # plugin) |
| 796 | try: |
| 797 | return cls.plugins[("default", statement._effective_plugin_target)] |
| 798 | except KeyError: |
| 799 | return None |
| 800 | |
| 801 | @classmethod |
| 802 | def _get_plugin_class_for_plugin( |