question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handle Json ExtensionData in sql translation visitor

See original GitHub issue

Describe the bug Given an object like this:

class MyEntity
{
    public string MyTypedProperty { get; set; }

    [JsonExtensionData]
    public Dictionary<string, System.Text.Json.JsonElement>? ExtensionData { get; set; }
}

Querying against an entity with extensiondata is not possible within a LINQ expression

{l => (Convert(l.ExtensionData.get_Item("MyTest"), Object) == Convert(100, Object))}

Should convert to:

WHERE root["MyTest"] == 100

Instead converts to

WHERE root["ExtensionData"]["MyTest"] == 100

The underlying entity in Cosmos will serialize like this;

{
    "MyTest": 100
}

So it is impossible to query for the “MyTest” field without dropping down to writing raw QueryDefinitions, in which case you do not have the benefit of strongly-typed expressions for the rest of your query

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
adityasacommented, Apr 26, 2023

Hey @onionhammer, I am taking a look at this item. I have looked and approved 2 of your other prs.

1reaction
neildshcommented, Apr 3, 2023

Hello @onionhammer my apologies that the ball was dropped on your other PRs. I will ping the people who were reviewing those PRs, and we will try to get them merged. We can take this particular issue forward once the other PRs have been resolved. Please note that the other PRs will likely not be merged before next week. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Work with JSON data in SQL Server
Parse JSON text and read or modify values. Transform arrays of JSON objects into table format. Run any Transact-SQL query on the converted ......
Read more >
How to parse JSON in SQL Server
This article will show how we can parse and query the JSON in SQL Server with the help of the OPENJSON() function.
Read more >
Untitled
Net STandard 2.0 - Unity Forum Custom Dictionary JsonConverter using System.Text.Json - Josef Otto… Handle Json ExtensionData in sql translation visitor ...
Read more >
Using an SQL interface to handle JSON data in Db2 for z/OS
This tutorial focuses on an SQL interface that was introduced in Db2 11 for z/OS that enables you to extract and retrieve JSON...
Read more >
Working with JSON data in GoogleSQL | BigQuery
You can create JSON values in the following ways: Use SQL to create a JSON literal. Use the PARSE_JSON function to convert a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found