Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/sqlalchemy/sql/__pycache__/compiler.cpython-39.pyc
Ðазад
a _�h�� � J @ sp d Z ddlZddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lm Z dd lmZ ddlmZ dd lm Z ddlmZ eg d��Ze�dej�Ze�dej�Zdd� edd�D ��dg�Ze�dej�Ze�dej�Ze�dej�Ze�dej�Ze�dej�Zdddddd�Zejd ej d!ej!d"ej"d#ej#d$ej$d%ej%d&ej&d%ej'd'ej(d(ej)d)ej*d*ej+d+ej,d,ej-d-ej.d.ej/d/ej0d0ej1d1ej2d2ej3d3ej4d4ej5d5ej6d6ej7d7ej8d8ej9d9ej:d:ej;d;ej<d<ej=d=ej>d>ej?d?ej@d@ejAdAejBdBejCdCi%ZDejEdDejFdEejGdFejHdGejIdHejJdIejKdJejLdKejMdLejNdMejOdNejPdOejQdPejRdQiZSdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`da�ZTe jUjVdbe jUjWdce jUjXdde jUjYdee jUjZdfe jUj[dgiZ\G dhdi� die]�Z^G djdk� dke�_ej`e]��ZaG dldm� dmejb�ZcG dndo� doed�ZeG dpdq� dqe^�ZfG drds� dsef�ZgG dtdu� due^�ZhG dvdw� dwea�ZiG dxdy� dyei�ZjG dzd{� d{e]�ZkdS )|a] Base SQL and DDL compiler implementations. Classes provided include: :class:`.compiler.SQLCompiler` - renders SQL strings :class:`.compiler.DDLCompiler` - renders DDL (data definition language) strings :class:`.compiler.GenericTypeCompiler` - renders type specification strings. To generate user-defined SQL strings, see :doc:`/ext/compiler`. � N� )�crud)�elements)� functions)� operators)�schema)� selectable)�sqltypes)�visitors� )�exc)�util)^�allZanalyseZanalyze�and�any�array�as�ascZ asymmetric� authorizationZbetween�binaryZboth�case�cast�check�collate�column� constraint�create�cross�current_dateZcurrent_role�current_time�current_timestamp�current_user�default� deferrable�descZdistinct�do�else�end�except�false�forZforeign�freeze�from�fullZgrant�groupZhavingZilike�in� initially�innerZ intersectZinto�isZisnull�join�leading�left�like�limit� localtime�localtimestampZnatural�new�notZnotnull�null�off�offset�old�on�only�or�order�outer�overlapsZplacing�primaryZ references�right�select�session_user�setZsimilarZsome� symmetric�tableZthen�toZtrailing�true�union�unique�user�using�verbose�when�wherez ^[A-Z0-9_$]+$z^[A-Z0-9_ $]+$c C s h | ]}t |��qS � )�str)�.0�xrV rV ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/sqlalchemy/sql/compiler.py� <setcomp>� � r[ � �$z5^(?:RESTRICT|CASCADE|SET NULL|NO ACTION|SET DEFAULT)$z^(?:DEFERRED|IMMEDIATE)$z%(?<![:\w\$\x5c]):([\w\$]+)(?![:\w\$])z\x5c(:[\w\$]*)(?![:\w\$])z %%(%(name)s)s�?z%%sz:[_POSITION]z :%(name)s)�pyformatZqmark�format�numeric�namedz AND z OR z + z * z - z / � % �-z < z <= z != z > z >= z = z IS DISTINCT FROM z IS NOT DISTINCT FROM z || z MATCH z NOT MATCH z IN z NOT IN �, z FROM � AS z IS z IS NOT z COLLATE zEXISTS � DISTINCT zNOT zANY zALL z DESCz ASCz NULLS FIRSTz NULLS LAST�coalesceZCURRENT_DATEZCURRENT_TIMEZCURRENT_TIMESTAMPZCURRENT_USERZ LOCALTIMEZLOCALTIMESTAMP�random�sysdateZSESSION_USER�USERZCUBEZROLLUPz GROUPING SETS�month�day�year�second�hour�doy�minute�quarter�dow�week�epoch�milliseconds�microseconds� timezone_hour�timezone_minute)rm rn ro rp rq rr rs rt ru rv rw rx ry rz r{ �UNIONz UNION ALL�EXCEPTz EXCEPT ALL� INTERSECTz INTERSECT ALLc @ s� e Zd ZdZdZdZe�� Zdde�� fdd�Z e� dd�dd� �Zd d � Ze dd� �Zd d� Zdd� Zddd�Ze dd� �Zdd� Zdd� ZdS )�Compileda Represent a compiled SQL or DDL expression. The ``__str__`` method of the ``Compiled`` object should produce the actual text of the statement. ``Compiled`` objects are specific to their underlying database dialect, and also may or may not be specific to the columns referenced within a particular set of bind parameters. In no case should the ``Compiled`` object be dependent on the actual values of those bind parameters, even though it may reference those values as defaults. Nc C sl || _ || _| j j| _|| _|r.| j�|�| _|durh|| _|j| _| jrR|j | _ | j| jfi |��| _dS )a| Construct a new :class:`.Compiled` object. :param dialect: :class:`.Dialect` to compile against. :param statement: :class:`_expression.ClauseElement` to be compiled. :param bind: Optional Engine or Connection to compile this statement against. :param schema_translate_map: dictionary of schema names to be translated when forming the resultant SQL .. versionadded:: 1.1 .. seealso:: :ref:`schema_translating` :param compile_kwargs: additional kwargs that will be passed to the initial call to :meth:`.Compiled.process`. N) �dialect�bindZidentifier_preparer�preparer�schema_translate_map�_with_schema_translate� statementZsupports_execution�can_execute�_execution_options�execution_options�process�string)�selfr� r� r� r� �compile_kwargsrV rV rZ �__init__ s �zCompiled.__init__z0.7z�The :meth:`.Compiled.compile` method is deprecated and will be removed in a future release. The :class:`.Compiled` object now runs its compilation within the constructor, and this method does nothing.c C s dS )z;Produce the internal string representation of this element.NrV �r� rV rV rZ �compileD s zCompiled.compilec C s$ | j r|�| ||�S t�| j��d S �N)r� �_execute_compiledr ZObjectNotExecutableErrorr� )r� � connection�multiparams�paramsrV rV rZ �_execute_on_connectionO s zCompiled._execute_on_connectionc C s t � �dS )z�Return a Compiled that is capable of processing SQL expressions. If this compiler is one, it would likely just return 'self'. N��NotImplementedErrorr� rV rV rZ �sql_compilerU s zCompiled.sql_compilerc K s |j | fi |��S r� ��_compiler_dispatch)r� �obj�kwargsrV rV rZ r� _ s zCompiled.processc C s | j pdS )z3Return the string text of the generated SQL or DDL.� )r� r� rV rV rZ �__str__b s zCompiled.__str__c C s t � �dS )z�Return the bind params for this compiled object. :param params: a dict of string/object pairs whose values will override bind values compiled in to the statement. Nr� �r� r� rV rV rZ �construct_paramsg s zCompiled.construct_paramsc C s | � � S )z0Return the bind params for this compiled object.�r� r� rV rV rZ r� q s zCompiled.paramsc O s* | j }|du rtjddd��|�| ||�S )zExecute this compiled object.Nz>This Compiled object is not bound to any Engine or Connection.Z2afi��code)r� r ZUnboundExecutionErrorr� )r� r� r� �erV rV rZ �executev s �zCompiled.executec O s | j |i |���� S )zJExecute this compiled object and return the result's scalar value.)r� �scalar)r� r� r� rV rV rZ r� � s zCompiled.scalar)N)�__name__� __module__�__qualname__�__doc__Z_cached_metadatar� r � immutabledictr� r� � deprecatedr� r� �propertyr� r� r� r� r� r� r� rV rV rV rZ r � s. � 0� r c @ s$ e Zd ZdZdZdd� Zdd� ZdS )�TypeCompilerz2Produces DDL specification for TypeEngine objects.z visit_\w+c C s || _ d S r� )r� )r� r� rV rV rZ r� � s zTypeCompiler.__init__c K s |j | fi |��S r� r� �r� �type_�kwrV rV rZ r� � s zTypeCompiler.processN)r� r� r� r� Zensure_kwargr� r� rV rV rV rZ r� � s r� c @ sB e Zd ZdZdZdZddd�Zedd� �Zed d � �Z dd� Z d S )� _CompileLabelz;lightweight label object which acts as an expression.Label.�label)�element�namerV c C s || _ || _|f| | _d S r� )r� r� � _alt_names)r� �colr� � alt_namesrV rV rZ r� � s z_CompileLabel.__init__c C s | j jS r� )r� � proxy_setr� rV rV rZ r� � s z_CompileLabel.proxy_setc C s | j jS r� )r� �typer� rV rV rZ r� � s z_CompileLabel.typec K s | S r� rV )r� r� rV rV rZ � self_group� s z_CompileLabel.self_groupN)rV )r� r� r� r� �__visit_name__� __slots__r� r� r� r� r� rV rV rV rZ r� � s r� c @ s e Zd ZdZdd� ZdS )�prefix_anon_mapac A map that creates new keys for missing key access. Considers keys of the form "<ident> <name>" to produce new symbols "<name>_<index>", where "index" is an incrementing integer corresponding to <name>. Inlines the approach taken by :class:`sqlalchemy.util.PopulateDict` which is otherwise usually used for this type of operation. c C sD |� dd�\}}| �|d�}|d | |<