* optimize gormSourceDir replace
* fmt.Errorf adjust and Optimize for-break
* strings trim
* feat: avoid using the same name field and if..else optimization adjustment
* optimization callbacks/create.go Create func if...else logic
* fix: callbacks/create.go Create func
* fix FileWithLineNum func and add gormSourceDir unit test
* remove debug print and utils_filenum_test.go
* Respect ignore migration when add column (#4276)
continue https://github.com/go-gorm/gorm/pull/4028
* feat: Optimal value type acquisition for v (#4278)
* feat: optimize relect value length and value
* feat: optimize ConvertSliceOfMapToValuesForCreate method
Co-authored-by: yrong1997 <yrong1997@gmail.com>
* for Config.cacheStore store PreparedStmtDB key
* invalid db error and value and invalid value length error (#4151)
* support named params in Select API (#4142)
* adds support for named arguments in select
* changes clause identifies and adds test
* optimize match english letters and midline
Co-authored-by: Ratan Phayade <ratanphayade@users.noreply.github.com>
* change the method of initializing slice and fixed the length to be specified as 0
* keep the association.go code in the var group
* keep the association.go code in the var group
* change to initializing in var group
* Change NameReplacer to an interface, allowing custom Replacers.
* Add NoLowerCase option to skip the snake_casing of names.
* Move sync.Map from global variable into member of NamingStrategy.
This maintains backward compatibility by making the smap optional - the
NamingStrategy still works if it is nil. gorm.Open activates it by
calling Init() if the given Namer is a schema.NamingStrategy.
Also, this changes the key stored in the smap to be the original name,
instead of the replaced name.
* Refactor NamingStrategy tests to add more assertions about how and when Replacers get called.
* Remove the name cache from NamingStrategy.
* Fix schema initialization paths
The initialized channel was only closed if the schema's cacheStore did not contain the embeddedCacheKey and there were no errors parsing relations. If the key existed or an error occurred, it would not be closed. This could leave other goroutines waiting for synchronization that will never occur.
Additionally, the other code paths that wait for initialization to complete did not return the possible error.
* Unnest common schema initialization
This makes the common code path less deeply nested and the flow control easier to follow.