Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
mock.cpython-313.pyc76 linesDownload Raw Back to __pycache__
1�

2��j���@�SSKJr SSKJr SSKrSSKJr SSKJr SSKJr SSKJr SSKJ	r	 SS	KJ3r4 S5SKJr
 SS
KJr \R(a6S6SKJr S7SKJr S8SKJr S9SKJr S10SKJr SSKJr SSKJr SSKJr SSKJr "SS5rSSjr g)�)�annotations)�11attrgetterN)�Any)�Callable)�cast)�Optional)�Type)�Union�)�url�)�util)�Engine)�_CoreAnyExecuteParams)�CoreExecuteOptionsParameter)�Dialect)�URL)�12Executable)�
InvokeDDLBase)�
HasSchemaAttr)�	Visitablec��\rSrSr%SSjr\"\\"S55rS\	S'\"\\"\13"S555rS\	S'\"\\"S	55rS14\	S'SSjr
SS
jrSSjrSSjrSSSjjrSrg)�MockConnection�#�dialectrc��XlX lg�N��_dialect�
_execute_impl)�selfr�executes   �\D:\code\apps\devtools\python\user_packages\Python313\site-packages\sqlalchemy/engine/mock.py�__init__�MockConnection.__init__$s
���
�$��c��U$r���ss r#�<lambda>�MockConnection.<lambda>(s��!r&r�enginerc�.�URR$r)r�namer)s r#r+r,*s��Q�Z�Z�_�_r&�strr/c��U$rr()r!�kwargss  r#�connect�MockConnection.connect,����r&c��UR$r)�schema)r!�objs  r#�schema_for_object� MockConnection.schema_for_object/s���z�z�r&c��U$rr()r!�kws  r#�execution_options� MockConnection.execution_options2r5r&c�V�SUS'U"SURUS.UD6RU5 g)NF�15checkfirst)r�16connectionr()r�traverse_single)r!�visitorcallable�elementr2s    r#�_run_ddl_visitor�MockConnection._run_ddl_visitor5s6�� %��|���	17��L�L�T�	18�5;�	19�20�/�'�21"r&Nc�$�URX5$r)r )r!r8�22parametersr=s    r#r"�MockConnection.execute@s���!�!�#�2�2r&r)rrr"zCallable[..., Any])r2r�returnr)r8rrJz
Optional[str])r<rrJr)rCzType[InvokeDDLBase]rDrr2rrJ�None)NN)r8rrHzOptional[_CoreAnyExecuteParams]r=z%Optional[CoreExecuteOptionsParameter]rJr)�__name__�23__module__�__qualname__�__firstlineno__r$rr�propertyr-�__annotations__rrr/r3r9r=rEr"�__static_attributes__r(r&r#rr#s���%��#�x��4�5�F�F�5��C��*�Z�*@�!A�B�G�W�B��S�(�#<�=�>�D�#�>����	#�,�	#��	#��		#�2425�	#�7;�CG�	3�
�3�4�3�A�	3�2627
�3�3r&rc���[R"U5nUR5n0n[R"U5HnXb;dM28URU5XV'M U"S0UD6n[
Xq5$)a�Create a "mock" engine used for echoing DDL.29 30This is a utility function used for debugging or storing the output of DDL31sequences as generated by :meth:`_schema.MetaData.create_all`32and related methods.33 34The function accepts a URL which is used only to determine the kind of35dialect to be used, as well as an "executor" callable function which36will receive a SQL expression object and parameters, which can then be37echoed or otherwise printed.   The executor's return value is not handled,38nor does the engine allow regular string statements to be invoked, and39is therefore only useful for DDL that is sent to the database without40receiving any results.41 42E.g.::43 44    from sqlalchemy import create_mock_engine45 46 47    def dump(sql, *multiparams, **params):48        print(sql.compile(dialect=engine.dialect))49 50 51    engine = create_mock_engine("postgresql+psycopg2://", dump)52    metadata.create_all(engine, checkfirst=False)53 54:param url: A string URL which typically needs to contain only the55 database backend name.56 57:param executor: a callable which receives the arguments ``sql``,58 ``*multiparams`` and ``**params``.  The ``sql`` parameter is typically59 an instance of :class:`.ExecutableDDLElement`, which can then be compiled60 into a string using :meth:`.ExecutableDDLElement.compile`.61 62.. versionadded:: 1.4 - the :func:`.create_mock_engine` function replaces63   the previous "mock" engine strategy used with64   :func:`_sa.create_engine`.65 66.. seealso::67 68    :ref:`faq_ddl_as_string`69 70r()�_url�make_url�get_dialectr�get_cls_kwargs�popr)r�executorr<�u�dialect_cls�dialect_args�krs        r#�create_mock_enginer^Isf��`	
�
�
�c��A��-�-�/�K��L�
�
 �
 ��
-���7� �f�f�Q�i�L�O�.�71�)�L�)�G��'�,�,r&)rzUnion[str, URL]rYrr<rrJr)!�72__future__r�operatorr�typingrrrrr	r73�rrTr�
TYPE_CHECKING�baser�74interfacesrrrr�sql.baser�sql.ddlr�75sql.schemar�sql.visitorsrrr^r(r&r#�<module>rjs~��#��
���������76����1�7�#��%�'�*�(�#3�#3�L=-�	�=-�$'�=-�/2�=-��=-r&
codekingpro/portable-devtools · Team Ai