Browse Source

Merge branch 'SqlSugar5' of github.com:donet5/SqlSugar

pull/11/head
sunkaixuna 3 years ago
parent
commit
0e5099153b
  1. 23
      README.md

23
README.md

@ -192,3 +192,26 @@ Split query
.SplitTable(DateTime.Now.Date.AddYears(-1), DateTime.Now)
.ToPageList(1,2); 
```
### Feature9: Big data insert or update
```cs
//Insert A million only takes a few seconds
db.Fastest<RealmAuctionDatum>().BulkCopy(GetList());
//update A million only takes a few seconds
db.Fastest<RealmAuctionDatum>().BulkUpdate(GetList());//A million only takes a few seconds完
db.Fastest<RealmAuctionDatum>().BulkUpdate(GetList(),new string[]{"id"},new string[]{"name","time"})//no primary key
//if exists update, else insert
var x= db.Storageable<Order>(data).ToStorage();
x.BulkCopy();
x.BulkUpdate();
//set table name
db.Fastest<RealmAuctionDatum>().AS("tableName").BulkCopy(GetList())
//set page
db.Fastest<Order>().PageSize(300000).BulkCopy(insertObjs);
```

Loading…
Cancel
Save