Files
aitsc/.venv/Lib/site-packages/sqlalchemy/engine/__pycache__/mock.cpython-312.pyc

75 lines
5.5 KiB
Plaintext
Raw Normal View History

2025-02-23 09:07:52 +08:00
<EFBFBD>
2025-08-29 00:34:40 +08:00
<00><19>h<EFBFBD><00><01>4<00>ddlmZddlmZddlZddlmZddlmZddlmZddlmZddlm Z dd lm
2025-02-23 09:07:52 +08:00
Z
d
2025-08-29 00:34:40 +08:00
d l m Z d d l mZejr6d
2025-02-23 09:07:52 +08:00
dlmZd
dlmZd
dlmZd
dlmZd
2025-08-29 00:34:40 +08:00
dl mZd dlmZd dlmZd dlmZd dlmZGd<17>d<18>Z dd<19>Z y)<1B>)<01> annotations)<01>
2025-02-23 09:07:52 +08:00
attrgetterN)<01>Any)<01>Callable)<01>cast)<01>Optional)<01>Type)<01>Union<6F>)<01>url<72>)<01>util)<01>Engine)<01>_CoreAnyExecuteParams)<01>CoreExecuteOptionsParameter)<01>Dialect)<01>URL)<01>
2025-08-29 00:34:40 +08:00
Executable)<01> InvokeDDLBase)<01> HasSchemaAttr)<01> Visitablec<01><><00>eZdZUdd<03>Zeeed<04><00><00>Zded<eeee d<07><00><00>Z
2025-02-23 09:07:52 +08:00
ded<eeed<08><00><00>Z d ed
2025-08-29 00:34:40 +08:00
<dd <0B>Z dd <0C>Z dd <0A>Z dd<0E>Z d dd<10>Zy)<18>MockConnection<6F>dialectrc<01> <00>||_||_y<00>N)<02>_dialect<63> _execute_impl)<03>selfr<00>executes <20>CD:\pythonpj\aitsc\.venv\Lib\site-packages\sqlalchemy/engine/mock.py<70>__init__zMockConnection.__init__$s<00><00><1F><04> <0A>$<24><04><1A>c<01><00>|Sr<00><00><01>ss r!<00><lambda>zMockConnection.<lambda>(s<00><00>!r#r<00>enginerc<01>.<00>|jjSr)r<00>namer&s r!r(zMockConnection.<lambda>*s <00><00>Q<EFBFBD>Z<EFBFBD>Z<EFBFBD>_<EFBFBD>_r#<00>strr+c <01><00>|Srr%)r<00>kwargss r!<00>connectzMockConnection.connect,<00><00><00><13> r#c<01><00>|jSr)<01>schema)r<00>objs r!<00>schema_for_objectz MockConnection.schema_for_object/s <00><00><12>z<EFBFBD>z<EFBFBD>r#c <01><00>|Srr%)r<00>kws r!<00>execution_optionsz MockConnection.execution_options2r0r#c <01>V<00>d|d<|d|j|d<03>|<03><01>j|<02>y)NF<4E>
checkfirst)r<00>
connectionr%)r<00>traverse_single)r<00>visitorcallable<6C>elementr.s r!<00>_run_ddl_visitorzMockConnection._run_ddl_visitor5s6<00><00> %<25><06>|<7C><1C><17>
<EFBFBD><18>L<EFBFBD>L<EFBFBD>T<EFBFBD>
<EFBFBD>5;<3B>
<EFBFBD>
<19>/<2F>'<27>
"r#Nc<01>&<00>|j||<02>Sr)r)rr3<00>
parametersr7s r!r zMockConnection.execute@s<00><00> <14>!<21>!<21>#<23>z<EFBFBD>2<>2r#)rrr zCallable[..., Any])r.r<00>returnr)r3rrAz Optional[str])r6rrAr)r<zType[InvokeDDLBase]r=rr.rrA<00>None)NN)r3rr@zOptional[_CoreAnyExecuteParams]r7z%Optional[CoreExecuteOptionsParameter]rAr)<11>__name__<5F>
__module__<EFBFBD> __qualname__r"rr<00>propertyr)<00>__annotations__rrr+r/r4r7r>r r%r#r!rr#s<><00><00>%<25><1A>#<23>x<EFBFBD> <0B>4<>5<>F<EFBFBD>F<EFBFBD>5<><1B>C<EFBFBD><18>*<2A>Z<EFBFBD>*@<40>!A<>B<>G<EFBFBD>W<EFBFBD>B<><14>S<EFBFBD>(<28>#<<3C>=<3D>><3E>D<EFBFBD>#<23>><3E><14><1A><14> #<23>,<2C> #<23><1B> #<23><16> #<23>
2025-02-23 09:07:52 +08:00
2025-08-29 00:34:40 +08:00
<0E> #<23>7;<3B>CG<43> 3<> <17>3<>4<>3<>A<01> 3<>
2025-02-23 09:07:52 +08:00
2025-08-29 00:34:40 +08:00
<0A> 3r#rc <01><><00>tj|<00>}|j<00>}i}tj|<04>D]}||vs<01>|j |<06>||<<00>|di|<05><01>}t ||<01>S)a?Create a "mock" engine used for echoing DDL.
2025-02-23 09:07:52 +08:00
This is a utility function used for debugging or storing the output of DDL
sequences as generated by :meth:`_schema.MetaData.create_all`
and related methods.
The function accepts a URL which is used only to determine the kind of
dialect to be used, as well as an "executor" callable function which
will receive a SQL expression object and parameters, which can then be
echoed or otherwise printed. The executor's return value is not handled,
nor does the engine allow regular string statements to be invoked, and
is therefore only useful for DDL that is sent to the database without
receiving any results.
E.g.::
from sqlalchemy import create_mock_engine
def dump(sql, *multiparams, **params):
print(sql.compile(dialect=engine.dialect))
engine = create_mock_engine("postgresql+psycopg2://", dump)
metadata.create_all(engine, checkfirst=False)
:param url: A string URL which typically needs to contain only the
database backend name.
:param executor: a callable which receives the arguments ``sql``,
``*multiparams`` and ``**params``. The ``sql`` parameter is typically
an instance of :class:`.ExecutableDDLElement`, which can then be compiled
into a string using :meth:`.ExecutableDDLElement.compile`.
.. versionadded:: 1.4 - the :func:`.create_mock_engine` function replaces
the previous "mock" engine strategy used with
:func:`_sa.create_engine`.
.. seealso::
:ref:`faq_ddl_as_string`
2025-08-29 00:34:40 +08:00
r%)<07>_url<72>make_url<72> get_dialectr<00>get_cls_kwargs<67>popr)r <00>executorr6<00>u<> dialect_cls<6C> dialect_args<67>krs r!<00>create_mock_enginerSIsl<00><00>` <0A> <0A> <0A>c<EFBFBD><1A>A<EFBFBD><13>-<2D>-<2D>/<2F>K<EFBFBD><15>L<EFBFBD> <11> <20> <20><1B> -<2D><01> <0C><02>7<EFBFBD> <20>f<EFBFBD>f<EFBFBD>Q<EFBFBD>i<EFBFBD>L<EFBFBD><11>O<EFBFBD>.<2E>
<1A>)<29>L<EFBFBD>)<29>G<EFBFBD> <19>'<27>8<EFBFBD> ,<2C>,r#)r zUnion[str, URL]rNrr6rrAr)!<21>
2025-02-23 09:07:52 +08:00
__future__r<00>operatorr<00>typingrrrrr r
<00>r rIr<00> TYPE_CHECKING<4E>baser<00>
2025-08-29 00:34:40 +08:00
interfacesrrrr<00>sql.baser<00>sql.ddlr<00>
sql.schemar<00> sql.visitorsrrrSr%r#r!<00><module>r_s~<00><01>#<23><1F> <0A><16><1B><17><1B><17><18><19><13>
<EFBFBD><17><17><1C>1<>7<>#<23><18>%<25>'<27>*<2A>(<28>#3<>#3<>L=-<2D> <18>=-<2D>$'<27>=-<2D>/2<>=-<2D><13>=-r#