- 优化 pgsql jsonb 映射,支持 List,mysql limit in 子查询;

This commit is contained in:
2881099
2021-11-02 00:38:06 +08:00
parent 65fe03a2ff
commit 3d5ca9bc7e
25 changed files with 192 additions and 22 deletions

View File

@@ -3,6 +3,7 @@ using FreeSql.DataAnnotations;
using FreeSql.Internal;
using FreeSql.Internal.CommonProvider;
using MySql.Data.MySqlClient;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -15,6 +16,35 @@ namespace FreeSql.Tests
{
public class UnitTest5
{
[Fact]
public void TestJsonb01()
{
var fsql = g.pgsql;
fsql.Delete<TestJsonb01Cls1>().Where("1=1").ExecuteAffrows();
var item = new TestJsonb01Cls1
{
jsonb01 = new List<int> { 1, 5, 10, 20 },
jsonb02 = new List<long> { 11, 51, 101, 201 },
jsonb03 = new List<string> { "12", "52", "102", "202" },
};
fsql.Insert(item).ExecuteAffrows();
var items = fsql.Select<TestJsonb01Cls1>().ToList();
}
public class TestJsonb01Cls1
{
public Guid id { get; set; }
[Column(MapType = typeof(JArray))]
public List<int> jsonb01 { get; set; }
[Column(MapType = typeof(JToken))]
public List<long> jsonb02 { get; set; }
[Column(MapType = typeof(JToken))]
public List<string> jsonb03 { get; set; }
}
[Fact]
public void DebugUpdateSet01()
{