efcore
efcore copied to clipboard
SQLite: Querying on byte[] JSON property doesn't work
See test JsonQuerySqliteTest.Json_predicate_on_byte_array.
according to documentation for json_extract:
SQL datatype of the result is NULL for a JSON null, INTEGER or REAL for a JSON numeric value, an INTEGER zero for a JSON false value, an INTEGER one for a JSON true value, the dequoted text for a JSON string value, and a text representation for JSON object and array values
We also return unexpected results when projecting byte array. for byte array 1, 2, 3 we actually return 48 49 48 50 48 51, so ASCII for 010203.
Non-JSON byte arrays work fine.
@maumar am no longer sure, but shouldn't we doing base64 decoding on the string data coming out of the JSON?
IIUC the SQLite provider represents byte[] as hex in JSON since 011f0ecc91d044e299eadd044ed0e990828b295e