U kf @s\ddlmZGdddejZGdddZGdddeejjZGdd d eejjZd S) )typesc@seZdZdZdS)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__rrO/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/dialects/sqlite/json.pyr src@s$eZdZddZddZddZdS)_FormatTypeMixincCs tdSN)NotImplementedErrorselfvaluerrr _format_value0sz_FormatTypeMixin._format_valuecs|fdd}|S)Ncs|}r|}|Sr rrrZ super_procrr process6s z0_FormatTypeMixin.bind_processor..process)Zstring_bind_processorrdialectrrrr bind_processor3s z_FormatTypeMixin.bind_processorcs|fdd}|S)Ncs|}r|}|Sr rrrrr rAs z3_FormatTypeMixin.literal_processor..process)Zstring_literal_processorrrrr literal_processor>s z"_FormatTypeMixin.literal_processorN)rrrrrrrrrr r /s r c@seZdZddZdS) JSONIndexTypecCs t|trd|}nd|}|S)Nz$[%s]z$."%s" isinstanceintr rrr rKs  zJSONIndexType._format_valueNrrrrrrrr rJsrc@seZdZddZdS) JSONPathTypecCsdddd|DS)Nz$%scSs&g|]}t|trd|nd|qS)z[%s]z."%s"r).0elemrrr Wsz.JSONPathType._format_value..)joinr rrr rTszJSONPathType._format_valueNrrrrr rSsrN)rrZsqltypesrr rrrrrr  s #