관리-도구
편집 파일: elements.cpython-37.pyc
B ��4]`Y � @ s d Z ddlmZ ddlZddlZddlZddlZddlmZ ddlm Z ddl mZ ddlm Z dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd� Zdd� Zdd� Zd�dd�Zd�dd�Zd�dd �Zd!d"� Zej G d#d$� d$e��Z!G d%d&� d&ej"e!�Z#G d'd(� d(e#�Z$G d)d*� d*e!�Z%G d+d,� d,ee!�Z&G d-d.� d.e#�Z'G d/d0� d0e#�Z(G d1d2� d2e#�Z)G d3d4� d4e!�Z*G d5d6� d6e*e#�Z+e+j,Z,e+j-Z-G d7d8� d8e*e#�Z.G d9d:� d:e#�Z/d�d;d<�Z0G d=d>� d>e#�Z1G d?d@� d@e#�Z2G dAdB� dBe#�Z3G dCdD� dDe#�Z4G dEdF� dFe#�Z5G dGdH� dHe#�Z6G dIdJ� dJe6�Z7G dKdL� dLe6�Z8G dMdN� dNe#�Z9G dOdP� dPe#�Z:G dQdR� dRe9�Z;G dSdT� dTe#�Z<e�=dU�Z>e�=dV�Z?G dWdX� dXe#�Z@G dYdZ� dZe#�ZAG d[d\� d\e#�ZBG d]d^� d^e#�ZCG d_d`� d`ee#�ZDG dadb� dbe#�ZEG dcdd� ddee!�ZFG dedf� dfeF�ZGG dgdh� dheF�ZHG didj� djeF�ZIG dkdl� dlejJejK�ZLG dmdn� dneL�ZMG dodp� dpeM�ZNG dqdr� dreM�ZOG dsdt� dteO�ZPePdu�ZQeMZRG dvdw� dweM�ZSdxdy� ZTdzd{� ZUd|d}� ZVd~d� ZWd�d�� ZXd�d�� ZYe�Zd��d�d�� �Z[d�d�� Z\d�d�� Z]d�d�� Z^d�d�� Z_d�d�� Z`d�d�� Zad�d�� Zbd�d�� Zcd�d�d��Zdd�d�� Zed�d�� Zfejgdfd�d��Zhd�d�� Zid�d�� Zjd�d�� Zkd�d�� Zld�d�d��Zme�nd�ejo�Zpd�d�� Zqd�d�� Zrd�d�� Zsd�d�d��ZtG d�d�� d�e�ZudS )�zpCore SQL expression elements, including :class:`.ClauseElement`, :class:`.ColumnElement`, and derived classes. � )�unicode_literalsN� )� operators)�type_api)� Annotated)�_generative)� Executable)� Immutable)�NO_ARG)�PARSE_AUTOCOMMIT)�cloned_traverse)�traverse)� Visitable� )�exc)� inspection)�utilc K s | � � S )N)�_clone)�element�kw� r �J/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/sql/elements.pyr $ s r c C s t �| d||f �S )Nz�.. warning:: The %s argument to %s can be passed as a Python string argument, which will be treated as **trusted SQL text** and rendered as given. **DO NOT PASS UNTRUSTED INPUT TO THIS PARAMETER**.)r Zadd_parameter_text)Z paramnameZmeth_rstZ param_rstr r r �_document_text_coercion( s r c C s t | �}t|t|�tj|jd�S )a� Return the clause ``expression COLLATE collation``. e.g.:: collate(mycolumn, 'utf8_bin') produces:: mycolumn COLLATE utf8_bin The collation expression is also quoted if it is a case sensitive identifier, e.g. contains uppercase characters. .. versionchanged:: 1.2 quoting is automatically applied to COLLATE expressions if they are case sensitive. )�type_)�_literal_as_binds�BinaryExpression�CollationClauser �collate�type)� expression� collation�exprr r r r 6 s r Fc C s t | �} | j|||d�S )aE Produce a ``BETWEEN`` predicate clause. E.g.:: from sqlalchemy import between stmt = select([users_table]).where(between(users_table.c.id, 5, 7)) Would produce SQL resembling:: SELECT id, name FROM user WHERE id BETWEEN :id_1 AND :id_2 The :func:`.between` function is a standalone version of the :meth:`.ColumnElement.between` method available on all SQL expressions, as in:: stmt = select([users_table]).where(users_table.c.id.between(5, 7)) All arguments passed to :func:`.between`, including the left side column expression, are coerced from Python scalar values if a the value is not a :class:`.ColumnElement` subclass. For example, three fixed values can be compared as in:: print(between(5, 3, 7)) Which would produce:: :param_1 BETWEEN :param_2 AND :param_3 :param expr: a column expression, typically a :class:`.ColumnElement` instance or alternatively a Python scalar expression to be coerced into a column expression, serving as the left side of the ``BETWEEN`` expression. :param lower_bound: a column or Python scalar expression serving as the lower bound of the right side of the ``BETWEEN`` expression. :param upper_bound: a column or Python scalar expression serving as the upper bound of the right side of the ``BETWEEN`` expression. :param symmetric: if True, will render " BETWEEN SYMMETRIC ". Note that not all databases support this syntax. .. versionadded:: 0.9.5 .. seealso:: :meth:`.ColumnElement.between` )� symmetric)r �between)r! Zlower_boundZupper_boundr"