The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
ifconfig

facebook/ent 可以只更新非零字段吗?

  •  
  •   ifconfig · Dec 26, 2020 · 1746 views
    This topic created in 1964 days ago, the information mentioned may be changed or developed.
    因为之前用习惯了 Gorm,当通过 struct 更新时,Gorm 只会更新非零字段,这样可以减少更新前判断的代码量。

    但是翻了一下 ent 的源码和 issue,貌似没有提供类似的操作。

    这样每次 setColumn 前都要对是否零值判断,请问有熟悉的朋友是怎么解决的吗?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   936 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 21:17 · PVG 05:17 · LAX 14:17 · JFK 17:17
    ♥ Do have faith in what you're doing.