Files
aitsc/.venv/Lib/site-packages/flask_sqlalchemy/__pycache__/session.cpython-312.pyc

42 lines
4.4 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>hb <00><01><><00>ddlmZddlZddlZddlmZddl m
2025-02-23 09:07:52 +08:00
Z ddl m Z ejrddlmZGd<06>de j"<00>Z d
d<08>Zd d <09>Zy) <0C>)<01> annotationsN)<01>app_ctx<74>)<01>
SQLAlchemyc<01>J<00><00>eZdZdZd<04>fd<02> Z d d<06>fd<03> Z<05>xZS)<07>Sessiona<6E>A SQLAlchemy :class:`~sqlalchemy.orm.Session` class that chooses what engine to
use based on the bind key associated with the metadata associated with the thing
being queried.
To customize ``db.session``, subclass this and pass it as the ``class_`` key in the
``session_options`` to :class:`.SQLAlchemy`.
.. versionchanged:: 3.0
Renamed from ``SignallingSession``.
2025-08-29 00:34:40 +08:00
c <01>@<00><01>t<00>|<00>di|<02><01>||_i|_y)N<>)<04>super<65>__init__<5F>_db<64>_model_changes)<04>self<6C>db<64>kwargs<67> __class__s <20><>ED:\pythonpj\aitsc\.venv\Lib\site-packages\flask_sqlalchemy/session.pyr zSession.__init__s"<00><><00> <0A><07><18>"<22>6<EFBFBD>"<22><15><04><08>?A<><04><1B>c <01><><00><01>|<03>|S|jj}|<01>0 tj|<01>}t|j|<05>}|<07>|S|<02>t||<05>}|<07>|Sd|vr|dSt<00>|<00>8d|||d<02>|<04><01>S#tj
2025-02-23 09:07:52 +08:00
$r6}t |t<00>r tjj|<01>|<06><02>d}~wwxYw)a<>Select an engine based on the ``bind_key`` of the metadata associated with
the model or table being queried. If no bind key is set, uses the default bind.
.. versionchanged:: 3.0.3
Fix finding the bind for a joined inheritance model.
.. versionchanged:: 3.0
The implementation more closely matches the base SQLAlchemy implementation.
.. versionchanged:: 2.1
Support joining an external transaction.
N)<03>mapper<65>clause<73>bindr
)r <00>engines<65>sa<73>inspect<63>sa_exc<78>NoInspectionAvailable<6C>
isinstance<EFBFBD>type<70>sa_orm<72>exc<78>UnmappedClassError<6F>_clause_to_engine<6E> local_tabler <00>get_bind) rrrrrr<00>e<>enginers <20>rr%zSession.get_binds<><00><><00>& <10> <1B><17>K<EFBFBD><16>(<28>(<28>"<22>"<22><07> <11> <1D> <16><1B><1A><1A>F<EFBFBD>+<2B><06>'<27>v<EFBFBD>'9<>'9<>7<EFBFBD>C<>F<EFBFBD><15>!<21><1D> <0A> <11> <1D>&<26>v<EFBFBD>w<EFBFBD>7<>F<EFBFBD><15>!<21><1D> <0A> <0F>7<EFBFBD>?<3F><1A>4<EFBFBD>=<3D> <20><14>w<EFBFBD><1F>R<>v<EFBFBD>f<EFBFBD>4<EFBFBD>R<>6<EFBFBD>R<>R<><52>)<1A>/<2F>/<2F> <16><1D>f<EFBFBD>d<EFBFBD>+<2B> <20>*<2A>*<2A>7<>7<><06>?<3F>Q<EFBFBD>F<><15><>  <16>s<00>A<<00><C<03>1C<03>C)rrr<00>t.Any<6E>return<72>None)NNN)
r<00> t.Any | Nonerr+rz.sa.engine.Engine | sa.engine.Connection | Nonerr(r)z'sa.engine.Engine | sa.engine.Connection)<07>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__r r%<00> __classcell__)rs@rrrsZ<00><><00> <08>B<01> $<24>#<23>?C<> /S<01><1C>/S<01><1D>/S<01>=<3D> /S<01>
<18> /S<01>
1<EFBFBD> /S<01>/Srrc<01><><00>d}|<00>gt|tj<00>r|}nJt|tj<00>r0t|jtj<00>r |j}|<02>Sd|j
j vr;|j
j d}||vrtjd|<03>d<04><03><00>||Sy)zeIf the clause is a table, return the engine associated with the table's
metadata's bind key.
N<>bind_keyz
Bind key 'z&' is not in 'SQLALCHEMY_BINDS' config.) rr<00>Table<6C>
UpdateBase<EFBFBD>table<6C>metadata<74>infor<00>UnboundExecutionError)rrr5<00>keys rr#r#Qs<><00><00> <11>E<EFBFBD> <0A><19> <15>f<EFBFBD>b<EFBFBD>h<EFBFBD>h<EFBFBD> '<27><1A>E<EFBFBD> <17><06><02> <0A> <0A> .<2E>:<3A>f<EFBFBD>l<EFBFBD>l<EFBFBD>B<EFBFBD>H<EFBFBD>H<EFBFBD>3U<33><1A>L<EFBFBD>L<EFBFBD>E<EFBFBD> <0C><18>Z<EFBFBD>5<EFBFBD>><3E>><3E>+><3E>+><3E>><3E><13>n<EFBFBD>n<EFBFBD>!<21>!<21>*<2A>-<2D><03> <0E>g<EFBFBD> <1D><18>.<2E>.<2E><1C>S<EFBFBD>E<EFBFBD>!G<>H<><0E> <0E><17>s<EFBFBD>|<7C><1B> rc<01><<00>ttj<00><00>S)zJGet the id of the current Flask application context for the session scope.)<03>idr<00>_get_current_objectr
rr<00> _app_ctx_idr=ms<00><00> <0A>g<EFBFBD>)<29>)<29>+<2B> ,<2C>,r)rzsa.ClauseElement | Nonerz't.Mapping[str | None, sa.engine.Engine]r)zsa.engine.Engine | None)r)<00>int)<14>
__future__r<00>typing<6E>t<>
sqlalchemyr<00>sqlalchemy.excr!r<00>sqlalchemy.orm<72>ormr <00> flask.globalsr<00> TYPE_CHECKING<4E> extensionrrr#r=r
rr<00><module>rIsZ<00><01>"<22><12><17><1F><1F>!<21><04>?<3F>?<3F>%<25>@S<01>f<EFBFBD>n<EFBFBD>n<EFBFBD>@S<01>F<10> #<23><10> 4<><10><1D><10>8-r