mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Merge branch 'SqlSugar5' of github.com:donet5/SqlSugar
This commit is contained in:
commit
1aaeac3c13
26
README.md
26
README.md
@ -16,6 +16,7 @@ Using SqlSugar is very simple , And it's powerful.
|
|||||||
## Description
|
## Description
|
||||||
|
|
||||||
- Support SqlServer、MySql and Oracle insert blukcopy
|
- Support SqlServer、MySql and Oracle insert blukcopy
|
||||||
|
- Split table big data self-processing
|
||||||
- Support Multi-tenant, multi-library transactions
|
- Support Multi-tenant, multi-library transactions
|
||||||
- Support Support CodeFirst data migration.
|
- Support Support CodeFirst data migration.
|
||||||
- Support Join query 、 Union all 、 Subquery
|
- Support Join query 、 Union all 、 Subquery
|
||||||
@ -166,3 +167,28 @@ var x = Db.Storageable(list).SplitInsert(it => !it.Any()).ToStorage()
|
|||||||
x.AsInsertable.ExecuteCommand();
|
x.AsInsertable.ExecuteCommand();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Feature8 :Auto split table
|
||||||
|
Split entity
|
||||||
|
```cs
|
||||||
|
[SplitTable(SplitType.Year)]//Table by year (the table supports year, quarter, month, week and day)
|
||||||
|
[SugarTable("SplitTestTable_{year}{month}{day}")]
|
||||||
|
public class SplitTestTable
|
||||||
|
{
|
||||||
|
[SugarColumn(IsPrimaryKey =true)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
//When the sub-table field is inserted, which table will be inserted according to this field.
|
||||||
|
//When it is updated and deleted, it can also be convenient to use this field to
|
||||||
|
//find out the related table
|
||||||
|
[SplitField]
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Split query
|
||||||
|
```cs
|
||||||
|
var lis2t = db.Queryable<OrderSpliteTest>()
|
||||||
|
.SplitTable(DateTime.Now.Date.AddYears(-1), DateTime.Now)
|
||||||
|
.ToPageList(1,2);
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user