zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
U
¸ý°d;
ã@s\ddlmZGdd„dejƒZGdd„dƒZGdd„deejjƒZGdd    „d    eejjƒZd
S) é)Útypesc@seZdZdZdS)ÚJSONaßSQLite JSON type.
 
    SQLite supports JSON as of version 3.9 through its JSON1_ extension. Note
    that JSON1_ is a
    `loadable extension <https://www.sqlite.org/loadext.html>`_ and as such
    may not be available, or may require run-time loading.
 
    :class:`_sqlite.JSON` is used automatically whenever the base
    :class:`_types.JSON` datatype is used against a SQLite backend.
 
    .. seealso::
 
        :class:`_types.JSON` - main documentation for the generic
        cross-platform JSON datatype.
 
    The :class:`_sqlite.JSON` type supports persistence of JSON values
    as well as the core index operations provided by :class:`_types.JSON`
    datatype, by adapting the operations to render the ``JSON_EXTRACT``
    function wrapped in the ``JSON_QUOTE`` function at the database level.
    Extracted values are quoted in order to ensure that the results are
    always JSON string values.
 
 
    .. versionadded:: 1.3
 
 
    .. _JSON1: https://www.sqlite.org/json1.html
 
    N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__©rrúVd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\sqlalchemy/dialects/sqlite/json.pyrsrc@s$eZdZdd„Zdd„Zdd„ZdS)Ú_FormatTypeMixincCs
tƒ‚dS©N)ÚNotImplementedError©ÚselfÚvaluerrr    Ú _format_value*sz_FormatTypeMixin._format_valuecsˆ |¡‰‡‡fdd„}|S)Ncsˆ |¡}ˆrˆ|ƒ}|Sr ©r©r©rZ
super_procrr    Úprocess0s
z0_FormatTypeMixin.bind_processor.<locals>.process)Zstring_bind_processor©rÚdialectrrrr    Úbind_processor-s
z_FormatTypeMixin.bind_processorcsˆ |¡‰‡‡fdd„}|S)Ncsˆ |¡}ˆrˆ|ƒ}|Sr rrrrr    r;s
z3_FormatTypeMixin.literal_processor.<locals>.process)Zstring_literal_processorrrrr    Úliteral_processor8s
z"_FormatTypeMixin.literal_processorN)rrrrrrrrrr    r
)s r
c@seZdZdd„ZdS)Ú JSONIndexTypecCs t|tƒrd|}nd|}|S)Nz$[%s]z$."%s"©Ú
isinstanceÚintr rrr    rEs
 
zJSONIndexType._format_valueN©rrrrrrrr    rDsrc@seZdZdd„ZdS)Ú JSONPathTypecCsdd dd„|Dƒ¡S)Nz$%sÚcSs&g|]}t|tƒrd|nd|‘qS)z[%s]z."%s"r)Ú.0Úelemrrr    Ú
<listcomp>Qsÿz.JSONPathType._format_value.<locals>.<listcomp>)Újoinr rrr    rNsþÿÿzJSONPathType._format_valueNrrrrr    rMsrN)rrZsqltypesrr
rrrrrr    Ú<module>s #