-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Use SQL Server json type by default for compatibility level 170 #36405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Will this also apply to reverse engineering? |
|
@ErikEJ this is specifically for ToJson(), i.e. mapping complex (or owned) types to the database - we can't reverse engineer that, since all we know is that there's a JSON column in the database and have no idea what .NET type should be mapped to it. When we see a Does that make sense, or am I missing something? |
|
@roji Makes sense, thanks |
| } | ||
|
|
||
| [ConditionalFact] | ||
| public void Json_is_mapped_to_nvarchar_with_UseSqlServer_with_compatibility_level_170() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public void Json_is_mapped_to_nvarchar_with_UseSqlServer_with_compatibility_level_170() | |
| public void Json_is_mapped_to_json_type_with_UseSqlServer_with_compatibility_level_170() |
|
The docs state:
This seems unclear about what to use with Azure SQL Managed Instance. If Azure SQL Managed Instance is configured with |
| // => TryFindJsonCollectionMapping( | ||
| // info.CoreTypeMappingInfo, modelType, providerType, ref elementMapping, out var comparer, out var collectionReaderWriter) | ||
| // ? (RelationalTypeMapping)FindMapping( | ||
| // info.WithConverter( | ||
| // // Note that the converter info is only used temporarily here and never creates an instance. | ||
| // new ValueConverterInfo(modelType, typeof(string), _ => null!)))! | ||
| // .WithComposedConverter( | ||
| // (ValueConverter)Activator.CreateInstance( | ||
| // typeof(CollectionToJsonStringConverter<>).MakeGenericType( | ||
| // modelType.TryGetElementType(typeof(IEnumerable<>))!), collectionReaderWriter!)!, | ||
| // comparer, | ||
| // comparer, | ||
| // elementMapping, | ||
| // collectionReaderWriter) | ||
| // : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing in #36407
|
@frankbuckley yeah, the docs should be clearer on the different Azure SQL offerings. |
For both structural mapping (ToJson() on complex type/owned entity) and scalar collections.
Closes #36372