Giter Site home page Giter Site logo

struct 查询有几个问题 about gf HOT 4 CLOSED

gogf avatar gogf commented on May 3, 2024
struct 查询有几个问题

from gf.

Comments (4)

gqcn avatar gqcn commented on May 3, 2024

@zhaopengme

  1. gform中使用struct作为参数时,支持使用gconv/json标签用来标识与数据表字段的对应关系;
  2. 这块需要改进一下;
  3. 这块我需要研究一下;

from gf.

gqcn avatar gqcn commented on May 3, 2024

@zhaopengme
我两天后考虑了一下,并且参考了其他ORM的做法。

关于struct默认值,在gform中默认值仍旧是有效的,struct的使用场景往往是记录与对象的映射时有用,在gform中主要是查询完毕数据后,再对数据结果集struct进行修改,随后可以使用Save方法对该记录集进行保存。目前不会改变这个逻辑,如果有更好的建议欢迎讨论。

继承这块,gform也不考虑支持struct的继承,虽然可以做得到,但对象的继承对于数据表来说相当于表与表重复字段的简便化管理,意义不是很大,反而增加了gform设计的复杂度。

如果有更好的想法,也欢迎讨论。

from gf.

zhaopengme avatar zhaopengme commented on May 3, 2024

如果不方便,你可以预留一些接口出来,我们自己来实现

from gf.

gqcn avatar gqcn commented on May 3, 2024

@zhaopengme 不太确定你需要什么样的接口,可以提出来我考虑下。

from gf.

Related Issues (20)

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.