/opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/sql/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/sql/__pycache__/ddl.cpython-311.pyc (54531B)
§
õoxJäã ó — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lm
Z
dd
lmZ ddlmZ G d„ d
e¦ « Z
G d„ dee
¦ « Z G d„ de¦ « Z G d„ de¦ « Z G d„ de¦ « Z G d„ de¦ « Z G d„ de¦ « Z G d„ de¦ « Z G d„ de
¦ « Z G d„ de¦ « Z G d „ d!e¦ « Z G d"„ d#e¦ « Z G d$„ d%e¦ « Z G d&„ d'e¦ « Z G d(„ d)e¦ « Z G d*„ d+e¦ « Z G d,„ d-e¦ « Z G d.„ d/e¦ « Z G d0„ d1e¦ « Z G d2„ d3e¦ « Z G d4„ d5e¦ « Z! G d6„ d7e!¦ « Z" G d8„ d9e!¦ « Z# d>d;„Z$ d?d=„Z%d:S )@zq
Provides the hierarchy of DDL-defining schema items as well as routines
to invoke them for a create/drop call.
é )Ú_bind_or_error)Ú_generative)Ú
Executable)Ú
SchemaVisitor)Ú
ClauseElementé )Úevent)Úexc)Úutil)Útopologicalc ó — e Zd Zd„ ZdS )Ú_DDLCompilesc ó — |j || fi |¤ŽS )zNReturn a compiler appropriate for this ClauseElement, given a
Dialect.)Úddl_compiler)ÚselfÚdialectÚkws úf/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib64/python3.11/site-packages/sqlalchemy/sql/ddl.pyÚ _compilerz_DDLCompiles._compiler s! € ð $ˆwÔ# G¨TÐ8Ð8°RÐ8Ð8Ð8ó N)Ú__name__Ú
__module__Ú__qualname__r © r r r r s# € € € € € ð9ð 9ð 9ð 9ð 9r r c ó — e Zd ZdZej ddi¦ « ZdZdZdZ dZ
d„ Zdd„Z e
j dd¦ « d „ ¦ « Zed
„ ¦ « Zedd„¦ « Zd„ Zd
„ Zd„ Zd„ Zd„ Zd„ Z eee¦ « Zd„ ZdS )Ú
DDLElementaÚ Base class for DDL expression constructs.
This class is the base for the general purpose :class:`.DDL` class,
as well as the various create/drop clause constructs such as
:class:`.CreateTable`, :class:`.DropTable`, :class:`.AddConstraint`,
etc.
:class:`.DDLElement` integrates closely with SQLAlchemy events,
introduced in :ref:`event_toplevel`. An instance of one is
itself an event receiving callable::
event.listen(
users,
'after_create',
AddConstraint(constraint).execute_if(dialect='postgresql')
)
.. seealso::
:class:`.DDL`
:class:`.DDLEvents`
:ref:`event_toplevel`
:ref:`schema_ddl_sequences`
Ú
autocommitTNc ó0 — | | ||¦ « S ©N)Ú_execute_ddl)r Ú
connectionÚmultiparamsÚparamss r Ú_execute_on_connectionz!DDLElement._execute_on_connectionG s € Ø×&Ò& t¨[¸&ÑAÔAÐAr c óâ — |€t | ¦ « }| ||¦ « r(| | |¦ « ¦ « S |j j d¦ « dS )a1 Execute this DDL immediately.
Executes the DDL statement in isolation using the supplied
:class:`.Connectable` or
:class:`.Connectable` assigned to the ``.bind``
property, if not supplied. If the DDL has a conditional ``on``
criteria, it will be invoked with None as the event.
:param bind:
Optional, an ``Engine`` or ``Connection``. If not supplied, a valid
:class:`.Connectable` must be present in the
``.bind`` property.
:param target:
Optional, defaults to None. The target :class:`_schema.SchemaItem`
for the execute call. Will be passed to the ``on`` callable if any,
and may also provide string expansion data for the statement.
See ``execute_at`` for more information.
Nz(DDL execution skipped, criteria not met.)r Ú_should_executeÚexecuteÚagainstÚengineÚloggerÚinfo)r ÚbindÚtargets r r' zDDLElement.executeJ sm € ð, ˆ<Ý! $Ñ'Ô'ˆDà×Ò ¨Ñ-Ô-ð PØ—<’< §¢¨VÑ 4Ô 4Ñ5Ô5Ð5àŒKÔ×#Ò#Ð$NÑOÔOÐOÐOÐOr ú0.7zÖThe :meth:`.DDLElement.execute_at` method is deprecated and will be removed in a future release. Please use the :class:`.DDLEvents` listener interface in conjunction with the :meth:`.DDLElement.execute_if` method.c óp ‡ ‡— ˆˆ fd„}t j |d‰ dd¦ « z |¦ « dS )a_ Link execution of this DDL to the DDL lifecycle of a SchemaItem.
Links this ``DDLElement`` to a ``Table`` or ``MetaData`` instance,
executing it when that schema item is created or dropped. The DDL
statement will be executed using the same Connection and transactional
context as the Table create/drop itself. The ``.bind`` property of
this statement is ignored.
:param event:
One of the events defined in the schema item's ``.ddl_events``;
e.g. 'before-create', 'after-create', 'before-drop' or 'after-drop'
:param target:
The Table or MetaData instance for which this DDLElement will
be associated with.
A DDLElement instance can be linked to any number of schema items.
``execute_at`` builds on the ``append_ddl_listener`` interface of
:class:`_schema.MetaData` and :class:`_schema.Table` objects.
Caveat: Creating or dropping a Table in isolation will also trigger
any DDL set to ``execute_at`` that Table's MetaData. This may change
in a future release.
c óx •— ‰j ‰| |fi |¤Žr(| ‰ | ¦ « ¦ « S d S r )Ú_should_execute_deprecatedr' r( )r- r! r Ú
event_namer s €€r Ú
call_eventz)DDLElement.execute_at.
.call_event‹ s] ø€ Ø.ˆtÔ.ؘF Jðð Ø24ðð ð
@ð "×)Ò)¨$¯,ª,°vÑ*>Ô*>Ñ?Ô?Ð?ð
@ð
@r Ú ú-Ú_N)r ÚlistenÚreplace)r r2 r- r3 s `` r Ú
execute_atzDDLElement.execute_ath sZ øø€ ðF @ð @ð @ð @ð @ð @õ Œ�V˜R *×"4Ò"4°S¸#Ñ">Ô">Ñ>À
ÑKÔKÐKÐKÐKr c ó — || _ dS )z9Return a copy of this DDL against a specific schema item.N)r- )r r- s r r( zDDLElement.against“ s € 𠈌ˆˆr c ó0 — || _ || _ || _ dS )a Return a callable that will execute this
DDLElement conditionally.
Used to provide a wrapper for event listening::
event.listen(
metadata,
'before_create',
DDL("my_ddl").execute_if(dialect='postgresql')
)
:param dialect: May be a string, tuple or a callable
predicate. If a string, it will be compared to the name of the
executing database dialect::
DDL('something').execute_if(dialect='postgresql')
If a tuple, specifies multiple dialect names::
DDL('something').execute_if(dialect=('postgresql', 'mysql'))
:param callable\_: A callable, which will be invoked with
four positional arguments as well as optional keyword
arguments:
:ddl:
This DDL element.
:target:
The :class:`_schema.Table` or :class:`_schema.MetaData`
object which is the
target of this event. May be None if the DDL is executed
explicitly.
:bind:
The :class:`_engine.Connection` being used for DDL execution
:tables:
Optional keyword argument - a list of Table objects which are to
be created/ dropped within a MetaData.create_all() or drop_all()
method call.
:state:
Optional keyword argument - will be the ``state`` argument
passed to this function.
:checkfirst:
Keyword argument, will be True if the 'checkfirst' flag was
set during the call to ``create()``, ``create_all()``,
``drop()``, ``drop_all()``.
If the callable returns a True value, the DDL statement will be
executed.
:param state: any value which will be passed to the callable\_
as the ``state`` keyword argument.
.. seealso::
:class:`.DDLEvents`
:ref:`event_toplevel`
N)r Ú callable_Ústate)r r r<