ego-component / egorm Goto Github PK
View Code? Open in Web Editor NEWgorm,ego,egorm
License: MIT License
gorm,ego,egorm
License: MIT License
add gorm metric stats
Describe the solution you'd like
buildquery.go:86
BuildQuery 函数 看起来仅支持构建 and
连接符的sql, 能否支持 or
呢
Describe alternatives you've considered
Cond struct {
// Cs MySQL中条件连接符,常量限制于 [AND,OR..]
Cs Constant
// Op MySQL中查询条件,如like,=,in
Op string
// Val 查询条件对应的值
Val interface{}
}
......\pkg\mod\gorm.io\plugin\[email protected]\dbresolver.go:139:18: cannot use map[string]gorm.Stmt{} (value of type map[string]gorm.Stmt) as map[string]*gorm.Stmt value in struct literal
......\pkg\mod\github.com\glebarez\[email protected]\sqlite.go:101:22: invalid operation: limit.Limit > 0 (mismatched types *int and untyped int)
......\pkg\mod\github.com\glebarez\[email protected]\sqlite.go:102:24: invalid operation: limit.Limit <= 0 (mismatched types *int and untyped int)
......\pkg\mod\github.com\glebarez\[email protected]\sqlite.go:103:21: cannot use -1 (untyped int constant) as *int value in assignment
......\pkg\mod\github.com\glebarez\[email protected]\sqlite.go:106:39: cannot use limit.Limit (variable of type *int) as int value in argument to strconv.Itoa
sql注释中加入trace id。方便在sql慢查询中,找到是哪个业务影响
目前最新版本egorm的sqlserver依赖是
gorm.io/driver/sqlserver v1.3.2
取自:
https://raw.githubusercontent.com/ego-component/egorm/master/go.mod
该版本,存在语法错误,影响项目编译, 语法错误发生在
https://github.com/go-gorm/sqlserver/blob/1648e291104c3e1882e40674fa9941ad46e57f27/sqlserver.go#L90C1-L90C1
问题原因,是
// limit.Limit 是指针类型 需要 *limit.Limit 和0作比较,而不是 指针直接和0作比较
目前该问题,在v1.4.0是修复好的
https://github.com/go-gorm/sqlserver/blob/v1.4.0/sqlserver.go#L90
修复建议,对egorm的go.mod,修改为 v1.4.0 (仅对该问题进行了调研,对其他变更的兼容影响未经测试)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.