gorose icon indicating copy to clipboard operation
gorose copied to clipboard

GoRose(go orm), a mini database ORM for golang, which inspired by the famous php framwork laravle's eloquent. It will be friendly for php developer and python or ruby developer. Currently provides six...

Results 47 gorose issues
Sort by recently updated
recently updated
newest added

代码如下 `func main() { wg = sync.WaitGroup{} for i := 0; i < 100; i++ { wg.Add(1) go data(1) } wg.Wait() } func data(id int) { db := dbUtil.DB().Table("tablename").Where("id", id)...

之前看文档的时候,有介绍通过 db.Connect() 来指定mysql 不同的数据库,但是对应的方法找不到了,想问下,如果业务中有多个database,如何实现database切换操作

这个还是很好用的

Execute无法执行lock tables 之类的sql

Execute无法执行lock tables 之类的sql

例如: db.Transaction(func(db gorose.IOrm) error { var obj Obj db.Table(&obj).Where("id", 1).Select() return nil }) 在这种情况下,obj对象无法被正确赋值,查询源码后发现是在orm.go/304执行了dba.ResetTable()这个方法,我认为Transaction中即使不ResetTable,也不会对参数产生感染,因此Transaction中的Reset()能否去掉ResetTable呢?

//计算总数 total,err := orm.Count() if err != nil { logger.Error(err.Error()) return total,nil,err } fmt.Println(orm.LastSql()) err = orm.Offset(offset).Limit(limit).Select() fmt.Println(orm.LastSql()) //结果 SELECT count(*) as count FROM ub_store LIMIT 1, [] SELECT count(*)...

包含查询,什么时候能支持下吗?

Engin 是有 preifx 的,SetPrefix("abc") 然后 .Table("information_schema.TABLES") 这样将会报错, from abcinformation_schema.TABLES

尝试自定义logger,发现无法满足需求,还需要进一步自定义session,这样就动作太大,恐怕影响升级 如果可以提供某种hook就好了