StaticConfig.SplitTableCreateTableFunc 方法存在bug? 返回
SqlSugar
沟通中
6
425
Liang 发布于1周前
悬赏:0 飞吻
StaticConfig.SplitTableCreateTableFunc = (type,insertObjs)=>
{
//如果插入频繁可以根据 insertObjs 有没有今天时间来验证是否清空缓存
};
新增的这个方法是不是有bug?只要调用Insertable方法就会触发这个事件,我的理解是只有创建表才触发;
比如:下面示例代码,会触发两次SplitTableCreateTableFunc,这样是不是就跟“CompleteInsertableFunc”这个一样了啊
var s1 = await this._dbClient.Insertable<ServerLogs>(new ServerLogs { Message = "test1", }).SplitTable().ExecuteReturnSnowflakeIdAsync(); Console.WriteLine(s1); var s2 = await this._dbClient.Insertable<ServerLogs>(new ServerLogs { Message = "test2", }).SplitTable().ExecuteReturnSnowflakeIdAsync(); Console.WriteLine(s2);
热忱回答(6)
-
fate sta VIP01周前
要验证是否创建表 就需要查询 表是不是存在
0 回复 -
fate sta VIP01周前
怎么都绕不开
0 回复 -
fate sta VIP01周前
你可以方内加逻辑今天是不是存入缓存
0 回复 -
fate sta VIP01周前
如果今天已经执行过插入,就不处理
0 回复 -
fate sta VIP01周前
就一个字典存key是实体+日期就行了
0 回复 -
Liang VIP01周前
好的,谢谢
0 回复