Dashboard
PHP:
8.2.30
OS:
Linux
User:
dh_nv8b2m
/
/
usr
/
local
/
lib
/
python3.10
/
dist-packages
/
sqlalchemy
/
sql
/
__pycache__
📤 Upload
📝 New File
📁 New Folder
Close
Editing: compiler.cpython-310.pyc
o [�hl� � @ s� 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�Zi ejd �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/�i ej0d0�ej1d1�ej2d2�ej3d3�ej4d4�ej5d5�ej6d6�ej7d7�ej8d8�ej9d9�ej: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)^�all�analyse�analyze�and�any�array�as�asc� asymmetric� authorization�between�binary�both�case�cast�check�collate�column� constraint�create�cross�current_date�current_role�current_time�current_timestamp�current_user�default� deferrable�desc�distinct�do�else�end�except�false�for�foreign�freeze�from�full�grant�group�having�ilike�in� initially�inner� intersect�into�is�isnull�join�leading�left�like�limit� localtime�localtimestamp�natural�new�not�notnull�null�off�offset�old�on�only�or�order�outer�overlaps�placing�primary� references�right�select�session_user�set�similar�some� symmetric�table�then�to�trailing�true�union�unique�user�using�verbose�when�wherez ^[A-Z0-9_$]+$z^[A-Z0-9_ $]+$c C s h | ]}t |��qS � )�str)�.0�xrl rl �B/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/compiler.py� <setcomp>� � rq � �$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)�pyformat�qmark�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�coalesce�CURRENT_DATE�CURRENT_TIME�CURRENT_TIMESTAMP�CURRENT_USER� LOCALTIME�LOCALTIMESTAMP�random�sysdate�SESSION_USER�USER�CUBE�ROLLUPz GROUPING SETS�month�day�year�second�hour�doy�minute�quarter�dow�week�epoch�milliseconds�microseconds� timezone_hour�timezone_minute)r� r� r� r� r� r� r� r� r� r� r� r� r� r� r� �UNIONz UNION ALL�EXCEPTz EXCEPT ALL� INTERSECTz INTERSECT ALLc @ s� e Zd ZdZdZe�� Z dde�� fdd�Ze� dd�dd� �Z d d � Zedd� �Z d d� Zdd� Zddd�Zedd� �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 sj || _ || _| j j| _|r| j�|�| _|dur3|| _|j| _| jr&|j| _ | j | jfi |��| _dS dS )aq Construct a new :class:`.Compiled` object. :param dialect: :class:`.Dialect` to compile against. :param statement: :class:`.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�bind�identifier_preparer�preparer�_with_schema_translate� statement�supports_execution�can_execute�_execution_options�execution_options�process�string)�selfr� r� r� �schema_translate_map�compile_kwargsrl rl rp �__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 � dS )zDProduce the internal string representation of this element. Nrl �r� rl rl rp �compileA s zCompiled.compilec C s | j r |�| ||�S t�| j���N)r� �_execute_compiledr �ObjectNotExecutableErrorr� )r� � connection�multiparams�paramsrl rl rp �_execute_on_connectionM s zCompiled._execute_on_connectionc C � t � �)z�Return a Compiled that is capable of processing SQL expressions. If this compiler is one, it would likely just return 'self'. ��NotImplementedErrorr� rl rl rp �sql_compilerS � zCompiled.sql_compilerc K � |j | fi |��S r� ��_compiler_dispatch)r� �obj�kwargsrl rl rp r� ] � zCompiled.processc C s | j pdS )z3Return the string text of the generated SQL or DDL.� )r� r� rl rl rp �__str__` � zCompiled.__str__c C r� )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. r� �r� r� rl rl rp �construct_paramse r� zCompiled.construct_paramsc C s | � � S )z0Return the bind params for this compiled object.�r� r� rl rl rp r� o 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.�2afi��code)r� r �UnboundExecutionErrorr� )r� r� r� �erl rl rp �executet s �zCompiled.executec O s | j |i |���� S )zJExecute this compiled object and return the result's scalar value.)r� �scalar)r� r� r� rl rl rp r� � s zCompiled.scalarr� )�__name__� __module__�__qualname__�__doc__�_cached_metadatar � immutabledictr� r� � deprecatedr� r� �propertyr� r� r� r� r� r� r� rl rl rl rp r� � s0 �/� 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� rl rl rp r� � � zTypeCompiler.__init__c K r� r� r� �r� �type_�kwrl rl rp r� � r� zTypeCompiler.processN)r� r� r� r� �ensure_kwargr� r� rl rl rl rp 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�namerl c C s || _ || _|f| | _d S r� )r� r� � _alt_names)r� �colr� � alt_namesrl rl rp r� � s z_CompileLabel.__init__c C � | j jS r� )r� � proxy_setr� rl rl rp r� � � z_CompileLabel.proxy_setc C r� r� )r� �typer� rl rl rp r� � r� z_CompileLabel.typec K � | S r� rl )r� r� rl rl rp � self_group� � z_CompileLabel.self_groupN)rl )r� r� r� r� �__visit_name__� __slots__r� r� r� r� r� rl rl rl rp 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 | |<