-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
是否有postload方法 #4899
Comments
这个还是preload,比如
这个函数,参数已经传递了answers了,我只是要填充answers中的Author字段,但是这个sql语句会有两个语句:
但是里面的第一个sql语句其实我是不想要的,所以我想,已经有了一个ansewers数组了,能不能有一个postload,能只加载Author,就是加载第二个sql语句? |
自定义预加载 的SQL 试试呢~ |
能再说的详细一些么?我理解预加载的sql是做不到的 |
抱歉,我理解错了,这的确不行。:zipper_mouth_face: |
This issue has been automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days |
Maybe we can add a |
@jinzhu 什么时候可以安排上,急需这个方法 |
Your Question
gorm有preload的方法,但是有的时候,我已经获取到了model或者model数组,想要加载其中的某个关联字段
比如
我已经获取到了as := []Answers,之后我想要加载Author字段,目前我只能使用
但是这个会增加一次
有没有办法有PostLoad之类的请求?还是我的使用有什么问题?
The document you expected this should be explained
Expected answer
The text was updated successfully, but these errors were encountered: