class documentation

class CompileState(object):

Known subclasses: sqlalchemy.orm.context.ORMCompileState, sqlalchemy.orm.persistence.BulkUDCompileState, sqlalchemy.sql.dml.DMLState, sqlalchemy.sql.selectable.CompoundSelectState, sqlalchemy.sql.selectable.SelectState

View In Hierarchy

Produces additional object state necessary for a statement to be compiled.

the .CompileState class is at the base of classes that assemble state for a particular statement object that is then used by the compiler. This process is essentially an extension of the process that the SQLCompiler.visit_XYZ() method takes, however there is an emphasis on converting raw user intent into more organized structures rather than producing string output. The top-level .CompileState for the statement being executed is also accessible when the execution context works with invoking the statement and collecting results.

The production of .CompileState is specific to the compiler, such as within the .SQLCompiler.visit_insert, .SQLCompiler.visit_select etc. methods. These methods are also responsible for associating the .CompileState with the .SQLCompiler itself, if the statement is the "toplevel" statement, i.e. the outermost SQL statement that's actually being executed. There can be other .CompileState objects that are not the toplevel, such as when a SELECT subquery or CTE-nested INSERT/UPDATE/DELETE is generated.

New in version 1.4.
Class Method create​_for​_statement Undocumented
Class Method get​_plugin​_class Undocumented
Class Method plugin​_for Undocumented
Class Method ​_get​_plugin​_class​_for​_plugin Undocumented
Method __init__ Undocumented
Class Variable __slots__ Undocumented
Class Variable plugins Undocumented
Instance Variable statement Undocumented
@classmethod
def get_plugin_class(cls, statement):

Undocumented

@classmethod
def plugin_for(cls, plugin_name, visit_name):

Undocumented

@classmethod
def _get_plugin_class_for_plugin(cls, statement, plugin_name):

Undocumented

def __init__(self, statement, compiler, **kw):
__slots__: tuple[str, ...] =

Undocumented

plugins: dict =

Undocumented