Pacific73 / gorm-cache

gorm v2的即插即用、无需修改代码的旁路缓存。An easy-to-use look-aside cache solution for gorm v2 users.
Apache License 2.0
112 stars 29 forks source link

Can gorm-cache support Raw SQL operations? #18

Closed rts-gordon closed 1 year ago

rts-gordon commented 1 year ago

Hi @Pacific73 Gorm-cache is a great project, but it can't support Raw SQL operations, may I get the reason?

Is there any plan to support Raw SQL operations in feature? Thank you.

Pacific73 commented 1 year ago

Sorry, we won't support raw sql execution cache. It's not because we don't have time, it's not feasible in theory instead. We cache queried models via json marshaling, while raw sql executions bring us sql.Row or sql.Rows struct, which cannot be cached via json marshaling.

rts-gordon commented 1 year ago

Thanks for your explain.