Clickhouse Array泛型插入测试

This commit is contained in:
d4ilys
2023-11-21 11:40:22 +08:00
parent 322332cf73
commit d91c7fbdfd
4 changed files with 37 additions and 3 deletions

View File

@ -114,7 +114,22 @@ namespace FreeSql.Tests.ClickHouse
[Fact]
public void ArrayBoolMappingSync()
{
_fsql.CodeFirst.SyncStructure(typeof(ArrayMappingTest));
_fsql.CodeFirst.SyncStructure(typeof(ArrayMappingTestSimple));
}
/// <summary>
/// 测试Array类型映射
/// </summary>
[Fact]
public void ArrayBoolMappingInsert()
{
_ = _fsql.Insert(new ArrayMappingTestSimple
{
Name = "daily",
Tags1 = new List<string>() { "a", "b", "c" },
Tags2 = new List<int>() { 1, 2, 3, 4 },
Tags3 = new List<bool>() { true, true, false }
}).ExecuteAffrows();
}
}
@ -153,4 +168,18 @@ namespace FreeSql.Tests.ClickHouse
[Column(Name = "tags7")] public IEnumerable<bool> Tags7 { get; set; }
}
[Table(Name = "table_test_array_simple")]
public class ArrayMappingTestSimple
{
[Column(Name = "name", IsPrimary = true)]
public string Name { get; set; }
[Column(Name = "tags1")] public IEnumerable<string> Tags1 { get; set; }
[Column(Name = "tags2")] public List<int> Tags2 { get; set; }
[Column(Name = "tags3")] public IEnumerable<bool> Tags3 { get; set; }
}
}

View File

@ -34,6 +34,11 @@
测试Array类型映射
</summary>
</member>
<member name="M:FreeSql.Tests.ClickHouse.ClickHouseTest3.ArrayBoolMappingInsert">
<summary>
测试Array类型映射
</summary>
</member>
<member name="T:FreeSql.Tests.ClickHouse.CollectDataEntityUpdate01">
<summary>
实时数据