问题标签 [go-xorm]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
34 浏览

mysql - 使用 Xorm 将多个 Select 查询作为批处理/管道运行

我们可以在 Go 中使用 Xorm 引擎将多个选择查询作为批处理/管道运行吗?我有一组 5 个查询,如果其中任何一个失败,我的整个逻辑都应该失败,但是如果它们成功,我需要所有这些查询的输出。所以我想节省单独运行与批量运行的往返时间。在 Go 中使用 Xorm 引擎有什么方法可以实现这一点?

0 投票
0 回答
187 浏览

mysql - go-xorm reverse mysql has error reverse.go:196 Error 1064: Unsupported command(COM_STMT_PREPARE)

I create a Apache Doris, add some tables into it's database. And I know Apache Doris support mysql to connect it.So I want to use go-xorm and mysql driver to connect Apache Doris. when I used this command "xorm reverse mysql username:password@ip:port/database?charset=utf8 ./templates/goxorm" to reverse mysql tables to structs in golang code, I got an error [Error] reverse.go:196 Error 1064: Unsupported command(COM_STMT_PREPARE) I have try to connect mysql and use _ "github.com/go-sql-driver/mysql" to connected it, can select some data from it. So I think mysql and tables are right. So I want to know if there is some function that go-xorm do not support. like "DATATIME" or "FLOAT". if Go-xorm NOT SUPPORT this, is there other golang tools to support like go-xorm?

0 投票
1 回答
52 浏览

go - 在启动 golang 时创建默认数量的数据库连接

我希望在应用程序启动时始终存在一些空闲的数据库连接。

我只能在 Golang 中看到MaxIdleConns和。MaxOpenConns我没有看到任何setMinIdle功能。帮助表示赞赏。

0 投票
0 回答
12 浏览

go - xorm , Sync 和 Sync2 函数之间的区别

xorm go 库有 2 个看起来相似的函数:

(虽然 Sync2() “文档”不包含它将添加列/索引等的解释,但实现似乎也这样做了)

这两个函数有什么区别,什么时候应该使用 Sync 什么时候应该使用 Sync2 ?