mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 增加 Oracle/达梦 BulkCopy 支持;
This commit is contained in:
@ -200,6 +200,16 @@ INTO ""TB_TOPIC_INSERT""(""CLICKS"") VALUES(900)
|
||||
//var items2 = insert.AppendData(items).ExecuteInserted();
|
||||
}
|
||||
|
||||
//[Fact]
|
||||
//public void ExecuteDmBulkCopy()
|
||||
//{
|
||||
// var items = new List<Topic>();
|
||||
// for (var a = 0; a < 10; a++) items.Add(new Topic { Id = a + 1, Title = $"newtitle{a}", Clicks = a * 100, CreateTime = DateTime.Now });
|
||||
|
||||
// insert.AppendData(items).InsertIdentity().ExecuteDmBulkCopy();
|
||||
// //Dm.DmException:<3A><>The fastloading dll not loading!<21><>
|
||||
//}
|
||||
|
||||
[Fact]
|
||||
public void AsTable()
|
||||
{
|
||||
|
@ -200,6 +200,26 @@ INTO ""TB_TOPIC_INSERT""(""CLICKS"") VALUES(:Clicks_9)
|
||||
//var items2 = insert.AppendData(items).ExecuteInserted();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExecuteOracleBulkCopy()
|
||||
{
|
||||
var items = new List<Topic_bulkcopy>();
|
||||
for (var a = 0; a < 10; a++) items.Add(new Topic_bulkcopy { Title = $"newtitle{a}", Clicks = a * 100, CreateTime = DateTime.Now });
|
||||
|
||||
g.oracle.Insert<Topic_bulkcopy>().AppendData(items).InsertIdentity().ExecuteOracleBulkCopy();
|
||||
//insert.AppendData(items).IgnoreColumns(a => new { a.CreateTime, a.Clicks }).ExecuteSqlBulkCopy();
|
||||
// System.NotSupportedException:“DataSet does not support System.Nullable<>.”
|
||||
}
|
||||
[Table(Name = "tb_topic_bulkcopy")]
|
||||
class Topic_bulkcopy
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public int? Clicks { get; set; }
|
||||
public TestTypeInfo Type { get; set; }
|
||||
public string Title { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AsTable()
|
||||
{
|
||||
|
Reference in New Issue
Block a user