GORM增加sqlcommenter特性

什么是sqlcommenter? sqlcommenter is a suite of middlewares/plugins that enable your ORMs to augment SQL statements before execution, with comments containing information about the code that caused its execution. This helps in easily correlating slow performance with source code and giving insights into backend database performance. In short it provides some observability into the state of...

2024-04-18 · 2 min · 742 words · Liudon

源码分析:GORM是如何生成sql的

在gorm下实现sqlcommenter过程中,遇到一些问题,顺便把gorm整个流程梳理了一遍,整理记录一下。 gorm使用示例 package main import ( "gorm.io/driver/mysql" "gorm.io/gorm" )...

2024-04-18 · 6 min · 2737 words · Liudon