Giter VIP home page Giter VIP logo

Comments (5)

Issues-translate-bot avatar Issues-translate-bot commented on June 11, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


  1. The pointer parameter currently passed from the Scan method can be passed to the bottom layer using ctx to complete the assignment.
  2. Regarding hooks, changing the underlying logic will make it incompatible with the current HookSelectInput.Next method, because users may rely on the return value of the Next method to do some processing on the data, and the changed logic will no longer be used. To return data by returning a value, you may need to add a new API or a new HookSelectInput.
  3. Some enhancements can be made to the Scan method. For example, the parameters support basic type slices and only support one-dimensional type slices.
  4. The caching logic in the Next method may need to be changed.
  5. For the time being, gconv.Convert is used to convert table field types to go language types.
  6. After the changes, it is recommended to abandon APIs such as One and All, and all use the Scan method for assignment, so that there is no need to copy back and forth through intermediate variables.

The call chain from the Scan method to the lowest level RowsToResult
Call chain

from gf.

wln32 avatar wln32 commented on June 11, 2024

@gqcn 强哥怎么看呢?

from gf.

Issues-translate-bot avatar Issues-translate-bot commented on June 11, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@gqcn What do you think of Brother Qiang?

from gf.

wln32 avatar wln32 commented on June 11, 2024

关于(*gdb.HookSelectInput).Next 方法不兼容,目前我想到了以下几种解决方案

  1. Next 方法的参数返回值全部不变,在Next 方法内部增加一个变量来判断用户是否调用了Next,如果是用户主动调用的,则把所有的值重新复制一份返回出去,或者使用原来的api去做底层查询
  2. Next 方法的参数返回值全部不变,为gdb.Result增加一些新的api,遍历或者设置其中的一些值,全部使用新的api来做
  3. 使用新的api来代替Next方法。

其实可以1和3结合一下,提供新的api,同时旧的Next方法不变,在注释上加上Deprecated标记,
然后多提倡用户使用新的api来做。

from gf.

Issues-translate-bot avatar Issues-translate-bot commented on June 11, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Regarding the incompatibility of the (*gdb.HookSelectInput).Next method, I currently have the following solutions in mind:

  1. All the parameter return values ​​of the Next method remain unchanged. Add a variable inside the Next method to determine whether the user has called Next. If the user actively calls Next, copy all the values ​​and return them, or use the original ones. api to do underlying queries
  2. The parameter return values ​​of the Next method remain unchanged. Add some new APIs to gdb.Result, traverse or set some of the values, and use the new APIs to do everything.
  3. Use the new API to replace the Next method.

In fact, you can combine 1 and 3 to provide a new API. At the same time, the old Next method remains unchanged, and the Deprecated mark is added to the annotation.
Then encourage users to use the new API.

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.