File: D:/Python311/Lib/site-packages/mysqlx/__pycache__/crud.cpython-311.pyc
�
�nc�b � �0 � d Z ddlZddlZddlmZ ddlmZmZmZm Z ddl
mZmZm
Z
ddlmZmZmZ ddlmZmZmZmZmZmZmZmZmZ d Zd
ZdZdZd
Z G d� d� � Z! G d� de!� � Z" G d� de!� � Z# G d� de!� � Z$ G d� de$� � Z%dS )z,Implementation of the CRUD database objects.� N� )�DbDoc)�ER_NO_SUCH_TABLE�ER_TABLE_EXISTS_ERROR�ER_X_CMD_NUM_ARGUMENTS�ER_X_INVALID_ADMIN_COMMAND)�NotSupportedError�OperationalError�ProgrammingError)�
deprecated�escape�quote_identifier) �AddStatement�CreateCollectionIndexStatement�DeleteStatement�
FindStatement�InsertStatement�ModifyStatement�RemoveStatement�SelectStatement�UpdateStatementz_SELECT COUNT(*) FROM information_schema.views WHERE table_schema = '{0}' AND table_name = '{1}'z`SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '{0}' AND table_name = '{1}'zJSELECT COUNT(*) FROM information_schema.schemata WHERE schema_name = '{0}'zSELECT COUNT(*) FROM {0}.{1}zDROP TABLE IF EXISTS {0}.{1}c �� � e Zd ZdZd� Zed� � � Zed� � � Zed� � � Zd� Z d� Z
d� Zd � Zd
� Z
edd� � d
� � � Z edd� � d� � � ZdS )�DatabaseObjectz�Provides base functionality for database objects.
Args:
schema (mysqlx.Schema): The Schema object.
name (str): The database object name.
c �� � || _ t |t � � r|� � � n|| _ | j � � � | _ | j � � � | _ d S �N) �_schema�
isinstance�bytes�decode�_name�get_session�_session�get_connection�_connection)�self�schema�names �-D:\Python311\Lib\site-packages\mysqlx/crud.py�__init__zDatabaseObject.__init__N s\ � ����&0��u�&=�&=�G�T�[�[�]�]�]�4��
���0�0�2�2��
��=�7�7�9�9����� c � � | j S )z,:class:`mysqlx.Session`: The Session object.�r"