-
Notifications
You must be signed in to change notification settings - Fork 860
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1758 from d4ilys/master
优化QuestDb BulkCopy 并重命名ClickHouse QuestDb BulkCopy 扩展方法名
- Loading branch information
Showing
6 changed files
with
143 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
FreeSql.Tests/FreeSql.Tests/QuestDb/QuestDbIssue/QuestDbIssue.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace FreeSql.Tests.QuestDb.QuestDbIssue | ||
{ | ||
public class QuestDbIssue : QuestDbTest | ||
{ | ||
[Fact] | ||
public void Issue1757() | ||
{ | ||
restFsql.CodeFirst.SyncStructure<Test0111>(); | ||
var count = fsql.Insert(new List<Test0111>() | ||
{ | ||
new() | ||
{ | ||
CreateTime = DateTime.Now, | ||
CustomId = 3, Name = "test333", | ||
Price = 3, | ||
Value = 3 | ||
} | ||
}).ExecuteQuestDbBulkCopy(); | ||
|
||
Assert.True(count > 0); | ||
|
||
var list = fsql.Select<Test0111>().ToList(); | ||
} | ||
|
||
|
||
[Fact] | ||
public void Issue1757Many() | ||
{ | ||
restFsql.CodeFirst.SyncStructure<Test0111>(); | ||
var count = fsql.Insert(new List<Test0111>() | ||
{ | ||
new() | ||
{ | ||
CreateTime = DateTime.Now, | ||
CustomId = 4, Name = "test444", | ||
Price = 4, | ||
Value = 4 | ||
}, | ||
new() | ||
{ | ||
CreateTime = DateTime.Now, | ||
CustomId = 5, Name = "test555", | ||
Price = 5, | ||
Value = 5 | ||
}, | ||
new() | ||
{ | ||
CreateTime = DateTime.Now, | ||
CustomId = 6, Name = "test666", | ||
Price = 6, | ||
Value = 6 | ||
} | ||
}).ExecuteQuestDbBulkCopy(); | ||
|
||
Assert.True(count > 0); | ||
|
||
var list = fsql.Select<Test0111>().ToList(); | ||
} | ||
} | ||
|
||
public class Test0111 | ||
{ | ||
public long Id { get; set; } | ||
|
||
public string Name { get; set; } | ||
public decimal Price { get; set; } | ||
public DateTime CreateTime { get; set; } | ||
public long CustomId { get; set; } | ||
|
||
public double Value { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters