Skip to content

Commit 342c560

Browse files
authored
Support mapping jsonpath (#3334)
Closes #3044
1 parent c484080 commit 342c560

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/EFCore.PG/Storage/Internal/NpgsqlTypeMappingSource.cs

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ static NpgsqlTypeMappingSource()
8484
private readonly NpgsqlCharacterCharTypeMapping _singleChar = new("character(1)");
8585
private readonly NpgsqlStringTypeMapping _xml = new("xml", NpgsqlDbType.Xml);
8686
private readonly NpgsqlStringTypeMapping _citext = new("citext", NpgsqlDbType.Citext);
87+
private readonly NpgsqlStringTypeMapping _jsonpath = new("jsonpath", NpgsqlDbType.JsonPath);
8788

8889
// JSON mappings - EF owned entity support
8990
private readonly NpgsqlOwnedJsonTypeMapping _jsonbOwned = new("jsonb");
@@ -234,6 +235,7 @@ public NpgsqlTypeMappingSource(
234235
{ "text", [_text] },
235236
{ "jsonb", [_jsonbString, _jsonbDocument, _jsonbElement] },
236237
{ "json", [_jsonString, _jsonDocument, _jsonElement] },
238+
{ "jsonpath", [_jsonpath] },
237239
{ "xml", [_xml] },
238240
{ "citext", [_citext] },
239241
{ "character varying", [_varchar] },

test/EFCore.PG.Tests/Storage/NpgsqlTypeMappingSourceTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public class NpgsqlTypeMappingSourceTest
4141
[InlineData("geometry(POLYGONM)", typeof(Polygon), null, null, null, false)]
4242
[InlineData("xid", typeof(uint), null, null, null, false)]
4343
[InlineData("xid8", typeof(ulong), null, null, null, false)]
44+
[InlineData("jsonpath", typeof(string), null, null, null, false)]
4445
public void By_StoreType(string typeName, Type type, int? size, int? precision, int? scale, bool fixedLength)
4546
{
4647
var mapping = CreateTypeMappingSource().FindMapping(typeName);

0 commit comments

Comments
 (0)