OwlCyberSecurity - MANAGER
Edit File: sqlite.cpython-312.pyc
� ֓�g; � �� � d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dl m Z d d l mZ d d l mZ d dl m Z d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ ddlmZ ddlmZ er6d dlmZ d dlmZ d dlm Z d dlm!Z! d dl"m#Z# d dl"m$Z$ d dl"m%Z% d dl&m'Z' ddl(m)Z) G d � d!e� Z* eed"� d%d#�� Z+ eed"� d&d$�� Z,y)'� )�annotationsN)�Any)�Dict)�Optional)� TYPE_CHECKING)�Union)�cast)�Computed)�JSON)�schema)�sql� )�alter_table)� ColumnName)�format_column_name)�format_table_name)�RenameTable)�DefaultImpl� )�util)�compiles)� Inspector)�DDLCompiler)�Cast)� ClauseElement)�Column)� Constraint)�Table)� TypeEngine)�BatchOperationsImplc � � � e Zd ZdZdZ dd�Zd d�Zd d�Z dd�Z dd�Z dd�Z d d� fd � Z dd �Zd� Z � xZS )� SQLiteImpl�sqliteFc �h � |j D ]� }|d dk( r�|d d }t |j t j � r0t |j j t j � r yt |j t � s��|j j s�� y|d dvs�� y y)z�Return True if the given :class:`.BatchOperationsImpl` would need the table to be recreated and copied in order to proceed. Normally, only returns True on SQLite when operations other than add_column are present. r � add_columnr T)�create_index� drop_indexF) �batch� isinstance�server_defaultr � DefaultClause�argr r r � persisted)�self�batch_op�op�cols �A/opt/hc_python/lib/python3.12/site-packages/alembic/ddl/sqlite.py�requires_recreate_in_batchz%SQLiteImpl.requires_recreate_in_batch1 s� � � �.�.�B��!�u��$���e�A�h����&�&��(<�(<�� ��!3�!3�!7�!7��9J�9J�K���s�1�1�8�<��*�*�4�4���A��<�<�� !� � c � � |j �t d� �|j | � rt j d� y y )N��No support for ALTER of constraints in SQLite dialect. Please refer to the batch mode feature which allows for SQLite migrations using a copy-and-move strategy.z�Skipping unsupported ALTER for creation of implicit constraint. Please refer to the batch mode feature which allows for SQLite migrations using a copy-and-move strategy.)�_create_rule�NotImplementedErrorr �warn�r. �consts r2 �add_constraintzSQLiteImpl.add_constraintM sJ � � ���%�%�D�� � � � �� %��I�I�D� � &r4 c �2 � |j �t d� �y )Nr6 )r7 r8 r: s r2 �drop_constraintzSQLiteImpl.drop_constraint^ s&