gpt4 book ai didi

sql - 如何在beg orm中获取finally sql字符串

转载 作者:数据小太阳 更新时间:2023-10-29 03:17:04 24 4
gpt4 key购买 nike

我想获取beego的orm中的finally sql字符串。

但是我找不到可以获取sql字符串的接口(interface)。

我想为数据库操作做一个日志。

想找其他不需要开启orm.Debug的方法。

orm.Debug = false

最佳答案

我想你想使用 orm.Debug 模式:

Setting orm.Debug to true will print out SQL queries

It may cause performance issues. It's not recommend to be used in production env.
....
Prints to os.Stderr by default.

You can change it to your own io.Writer

More info

关于sql - 如何在beg orm中获取finally sql字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28378800/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com