L i ddlmZGddejZGddZGddeejj ZGdd eejj Zy ) )typesceZdZdZy)JSONaSQLite JSON type. SQLite supports JSON as of version 3.9 through its JSON1_ extension. Note that JSON1_ is a `loadable extension `_ 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__e/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/json.pyrr sr rceZdZdZdZdZy)_FormatTypeMixinctN)NotImplementedErrorselfvalues r _format_valuez_FormatTypeMixin._format_value0s !##r c8j|fd}|S)Nc>j|}r|}|Srrrr super_procs r processz0_FormatTypeMixin.bind_processor..process6%&&u-E"5)Lr )string_bind_processorrdialectrrs` @r bind_processorz_FormatTypeMixin.bind_processor3s//8   r c8j|fd}|S)Nc>j|}r|}|Srrrs r rz3_FormatTypeMixin.literal_processor..processArr )string_literal_processorrs` @r literal_processorz"_FormatTypeMixin.literal_processor>s227;   r N)rrrrr r$r r r rr/s$  r rceZdZdZy) JSONIndexTypec>t|trd|z}|Sd|z}|S)Nz$[%s]z$."%s") isinstanceintrs r rzJSONIndexType._format_valueKs- eS !eOE u$E r Nrrrrr r r r&r&Jsr r&ceZdZdZy) JSONPathTypec ddj|Dcgc]}t|trd|znd|zc}zScc}w)Nz$%sz[%s]z."%s")joinr(r))rrelems r rzJSONPathType._format_valueTsN GG!&&0c%:FTM$N   s!; Nr*r r r r,r,Ss r r,N)r.rsqltypesrrr&r,r r r r2sW"8==F6$hmm&A&A  #X]]%?%?  r