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: schema.cpython-310.pyc
o [�h�� � @ s d Z ddlmZ ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl mZ dd l mZ dd l m Z ddl mZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ e�d�Ze�dd�Z dd� Z!dd � Z"ej#G d!d"� d"ee j$��Z%G d#d$� d$e e%e�Z&G d%d&� d&e e%e�Z'G d'd(� d(e e%�Z(G d)d*� d*e)�Z*G d+d,� d,e*e%�Z+G d-d.� d.e+�Z,G d/d0� d0e+�Z-ej#G d1d2� d2e*e��Z.G d3d4� d4e.�Z/e�0d5d6�G d7d8� d8e/��Z1G d9d:� d:e e%�Z2d;d<� Z3d=d>� Z4G d?d@� d@e)�Z5G dAdB� dBe5e2�Z6G dCdD� dDe6�Z7G dEdF� dFe6�Z8G dGdH� dHe6�Z9G dIdJ� dJe6�Z:G dKdL� dLe e5e%�Z;e�<dMdNi�Z=G dOdP� dPe%�Z>G dQdR� dRe>�Z?G dSdT� dTe)�Z@e@d�ZAe@jBZBG dUdV� dVe.e%�ZCdS )Wa/ The schema module provides the building blocks for database metadata. Each element within this module describes a database entity which can be created and dropped, or is otherwise part of such an entity. Examples include tables, columns, sequences, and indexes. All entities are subclasses of :class:`~sqlalchemy.schema.SchemaItem`, and as defined in this module they are intended to be agnostic of any vendor-specific constructs. A collection of entities are grouped into a unit called :class:`~sqlalchemy.schema.MetaData`. MetaData serves as a logical grouping of schema elements, and can also be associated with an actual database connection such that operations involving the contained elements can contact the database as needed. Two of the elements here also build upon their "syntactic" counterparts, which are defined in :class:`~sqlalchemy.sql.expression.`, specifically :class:`~sqlalchemy.schema.Table` and :class:`~sqlalchemy.schema.Column`. Since these objects are part of the SQL expression language, they are usable as components in SQL expressions. � )�absolute_importN� )�ddl)�type_api)�visitors)�_bind_or_error)�ColumnCollection)� DialectKWArgs)�SchemaEventTarget)� _as_truncated)�_document_text_coercion)�_literal_as_text)� ClauseElement)�ColumnClause)� ColumnElement)�quoted_name)� TextClause)�TableClause� ��event)�exc)� inspection)�util� retain_schema�blank_schemaz�Symbol indicating that a :class:`.Table` or :class:`.Sequence` should have 'None' for its schema, even if the parent :class:`.MetaData` has specified a schema. .. versionadded:: 1.0.14 c C s |d u r| S |d | S )N�.� )�name�schemar r �@/usr/local/lib/python3.10/dist-packages/sqlalchemy/sql/schema.py�_get_table_keyI s r! c s � �fdd�}t �| i |�S )Nc s0 t | t�r| j� u r| j� jv r�j| j S d S �N)� isinstance�Column�table�key�c)�col��source_table�target_tabler r �replaceS s � z!_copy_expression.<locals>.replace)r �replacement_traverse)� expressionr* r+ r, r r) r �_copy_expressionR s r/ c @ sb e Zd ZdZdZdd� Zdd� Zdd� Zee � d d �dd� ��Ze jd d� �Z dd� Zdd� ZdS )� SchemaItemz3Base class for items that define a database schema.�schema_itemc G sP |D ]#}|dur%z|j }W n ty t�t�d| �� Y qw || � qdS )z7Initialize the list of child items for this SchemaItem.NzJ'SchemaItem' object, such as a 'Column' or a 'Constraint' expected, got %r)�_set_parent_with_dispatch�AttributeErrorr �raise_from_causer � ArgumentError)�self�args�item�spwdr r r �_init_itemsf s ������zSchemaItem._init_itemsc K s g S )z"used to allow SchemaVisitor accessr �r6 �kwargsr r r �get_childrenw � zSchemaItem.get_childrenc C s t j| dgd�S )N�info)� omit_kwarg�r �generic_repr�r6 r r r �__repr__{ � zSchemaItem.__repr__�0.9z�The :attr:`.SchemaItem.quote` attribute is deprecated and will be removed in a future release. Use the :attr:`.quoted_name.quote` attribute on the ``name`` field of the target schema item to retrievequoted status.c C � | j jS )z�Return the value of the ``quote`` flag passed to this schema object, for those schema items which have a ``name`` field. )r �quoterC r r r rH ~ s zSchemaItem.quotec C s i S )aL Info dictionary associated with the object, allowing user-defined data to be associated with this :class:`.SchemaItem`. The dictionary is automatically generated when first accessed. It can also be specified in the constructor of some objects, such as :class:`.Table` and :class:`.Column`. r rC r r r r? � s zSchemaItem.infoc C s( d| j v r| j�� |_|j�| j� |S )Nr? )�__dict__r? �copy�dispatch�_update)r6 r1 r r r �_schema_item_copy� s zSchemaItem._schema_item_copyc C s |� ||�S r"