| 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( |