Comments (4)
- 在
gform
中使用struct
作为参数时,支持使用gconv
/json
标签用来标识与数据表字段的对应关系; - 这块需要改进一下;
- 这块我需要研究一下;
from gf.
@zhaopengme
我两天后考虑了一下,并且参考了其他ORM
的做法。
关于struct
默认值,在gform
中默认值仍旧是有效的,struct
的使用场景往往是记录与对象的映射时有用,在gform
中主要是查询完毕数据后,再对数据结果集struct
进行修改,随后可以使用Save
方法对该记录集进行保存。目前不会改变这个逻辑,如果有更好的建议欢迎讨论。
继承这块,gform
也不考虑支持struct
的继承,虽然可以做得到,但对象的继承对于数据表来说相当于表与表重复字段的简便化管理,意义不是很大,反而增加了gform
设计的复杂度。
如果有更好的想法,也欢迎讨论。
from gf.
如果不方便,你可以预留一些接口出来,我们自己来实现
from gf.
@zhaopengme 不太确定你需要什么样的接口,可以提出来我考虑下。
from gf.
Related Issues (20)
- gconv.Map OmitEmpty will panic, when nil field has String() method HOT 7
- In standard routing, when the input parameter is JSON Array, `json.RawMessage` cannot be used HOT 1
- The parameter format of InsertIgnore is questionable, not sure if it is a bug HOT 13
- use grpc with nacos problem
- `gf gen dao` link option doesn't work HOT 2
- gf gen ctrl When using the -m parameter, some functions are not generated HOT 1
- github.com/gogf/gf/contrib/registry/file/[email protected]/file_discovery.go 的97行代码会误删其他服务的注册文件 HOT 1
- string “NULL” in Query will treated as nil in STD router StructReq HOT 3
- gcache Memory leakage HOT 1
- Goai: How to modify openapi object gracefully after server run
- gstr.ReplaceIByMap function cannot convert the specified string into the specified content HOT 2
- It is recommended to remove sqlitecgo/v2’s dependence on sqlite/v2 HOT 1
- `gf gen service` command generate wrong package version
- gconv.Scan cannot bind string property to []float64 HOT 1
- [Serious] gproc command fail.
- Request validator tag "required-if" is invalid HOT 3
- proto file want use enums HOT 1
- proto file want use enums HOT 1
- Why is it so slow HOT 3
- `gf gen ctrl` uses AST to get Imports and CtrlDefinition of CGenCtrl.getApiItemsInDst
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gf.