Closed twz915 closed 1 year ago
related issues https://github.com/didi/gendry/issues/141 https://github.com/didi/gendry/issues/122
builder supports such as
update = map[string]interface{}{ "code": builder.Raw("VALUES(code)"), // mysql 8.x builder.Raw("new.code") "name": builder.Raw("VALUES(name)"), // mysql 8.x builder.Raw("new.name") } // INSERT INTO country (id, code, name) VALUES (?,?,?),(?,?,?),(?,?,?) // ON DUPLICATE KEY UPDATE code=VALUES(code),name=VALUES(name)
where := map[string]interface{}{"gmt_create <": builder.Raw("gmt_modified")} // SELECT * FROM x // WHERE gmt_create < gmt_modified
Thx, I'll review this pr later
我把默认的 VALUES 移除了,都让用户用的时候自己指定吧,这样好理解些
希望可以再加一点测试用例
已经添加单测
Thx for your contribution!
related issues https://github.com/didi/gendry/issues/141 https://github.com/didi/gendry/issues/122
builder supports such as