shuxinqin / Chloe

A lightweight and high-performance Object/Relational Mapping(ORM) library for .NET --C#
https://github.com/shuxinqin/Chloe/wiki
MIT License
1.52k stars 457 forks source link

希望能单独出个分表的demo #354

Closed xj728 closed 1 year ago

xj728 commented 1 year ago

希望能单独出个分表的demo

shuxinqin commented 1 year ago

https://github.com/shuxinqin/Chloe/blob/master/src/ChloeDemo/Sharding/ShardingTest.cs#L25 这个demo就是能跑的,建好数据库,改下ShardingTestImpl.cs 里的数据库连接字符串就可以了

shuxinqin commented 1 year ago

只分表的话其实简化版的分库分表(只有一个库),你理解 demo 里的 route 怎么编写的就知道怎么弄了,关键注释都有 https://github.com/shuxinqin/Chloe/blob/master/src/ChloeDemo/Sharding/OrderShardingRoute.cs

xj728 commented 1 year ago

用了很多年这个插件,唯独这个分表的看不懂 能写一个简单的按CreateTime 的Year分表的demo吗? 全部揉在一起,真的很难看懂