gen icon indicating copy to clipboard operation
gen copied to clipboard

SetDefault support set timeout

Open cruvie opened this issue 1 year ago • 2 comments

Describe the feature

SetDefault support set timeout option

Motivation

I have to use .WithContext(timeoutCtx) every time query sql, I try to use SetDefault's opts ...gen.DOOption,but DOConfig is an empty struct.

Related Issues

cruvie avatar Mar 30 '25 12:03 cruvie

SetDefault only needs to be initialized and called once, and the default timeout can be set by gorm initialization

qqxhb avatar Apr 08 '25 10:04 qqxhb

@qqxhb thanks for your response, I mean SetDefault set a default timeout by ops could be an useful feature . and I cannot find any option/config to set default timeout by gorm initialization, could you provide me more info?

cruvie avatar Apr 08 '25 10:04 cruvie

@qqxhb FYI https://github.com/go-gorm/gorm/pull/7567

cruvie avatar Aug 31 '25 06:08 cruvie