Giter VIP home page Giter VIP logo

egorm's Issues

egorm 的 BuildQuery 支持构建 'or' 连接符的sql语句吗?

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{}
	}

更新最新版本后,出现不兼容问题

gorm.io/plugin/dbresolver

......\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

github.com/glebarez/sqlite

......\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

sqlserver的依赖版本存在语法错误

目前最新版本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 (仅对该问题进行了调研,对其他变更的兼容影响未经测试)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.