8treenet / gcache

gcache是gorm的中间件,插入后gorm即刻拥有缓存。
Apache License 2.0
386 stars 52 forks source link

精确匹配字段名到ObjectField #21

Closed zsmatrix62 closed 3 years ago

zsmatrix62 commented 3 years ago

如果简单地使用 !strings.Contains 会导致,如果表包含列名(比如tbl_content和列content)则会错误地计算为 condition.ObjectField 导致缓存失败

zsmatrix62 commented 3 years ago

而且我好像发现使用 id in (?) 这样的方式也是获取不到缓存的 .. 然后我发现居然有标准写法 .. 囧了。

8treenet commented 3 years ago

sql太灵活了。全匹配太难,按规范方式才能覆盖到

八叉树 4932004@qq.com

------------------ 原始邮件 ------------------ 发件人: KyleHwang <notifications@github.com> 发送时间: 2020年12月9日 22:23 收件人: 8treenet/gcache <gcache@noreply.github.com> 抄送: Subscribed <subscribed@noreply.github.com> 主题: 回复:[8treenet/gcache] 精确匹配字段名到ObjectField (#21)

而且我好像发现使用 id in (?) 这样的方式也是获取不到缓存的 .. 然后我发现居然有标准写法 .. 囧了。

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

zsmatrix62 commented 3 years ago

这个地方不知道是不是也是这个问题需要修改 #134行

zsmatrix62 commented 3 years ago

sql太灵活了。全匹配太难,按规范方式才能覆盖到 八叉树 4932004@qq.com

我发现我有很多地方没有按照gorm的文档方式写,之前不怎么熟悉,后来发现大佬的缓存库有些吃不上,现在debug看看是不是我自己的毛病。😂