2731 Commits

Author SHA1 Message Date
Name
9703eb775f
perf: use strings.IndexByte to replace strings.Index (#7454)
Co-authored-by: 1911860538 <alxps1911@gmail.com>
2025-05-21 10:35:56 +08:00
Name
1c966e0d25
perf: use strings.Cut to replace strings.SplitN (#7455)
Co-authored-by: 1911860538 <alxps1911@gmail.com>
2025-05-21 10:35:23 +08:00
Jinzhu
e5b867e785 remove unnecessary session-level configuration for prepared statements v1.26.1 2025-05-07 14:56:49 +08:00
iTanken
8c4e8e2d2a
fix: int type variable defaultMaxSize overflows in 32-bit environment (#7439)
Refs: #7435
2025-04-27 14:05:16 +08:00
Zhaodong Xie
a827495be1
Preparestmt use LRU Map instead default map (#7435)
* 支持lru淘汰preparestmt cache

* 支持lru淘汰preparestmt cache

* 支持lru淘汰preparestmt cache

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* 只使用lru

* change const export

* Add stmt_store

* refact prepare stmt store

* Rename lru store

* change const export

* ADD UT

* format code and add session level prepare stmt config

* code format according to golinter ci

* ADD UT

---------

Co-authored-by: xiezhaodong <xiezhaodong@bytedance.com>
Co-authored-by: Jinzhu <wosmvp@gmail.com>
v1.26.0
2025-04-25 16:22:26 +08:00
Jinzhu
489a563293 only check new issues for golangci linter 2025-04-17 15:30:17 +08:00
Jinzhu
42bd4f603c
use golangci replace reviewdog (#7426)
* use golangci replace reviewdog

* Update golangci config
2025-04-17 11:55:13 +08:00
a631807682
a9d27293de test: mssql ci 2025-03-11 15:56:46 +08:00
a631807682
3876ffe4bb test: mssql ci 2025-03-11 15:56:46 +08:00
Jinzhu
ee3b549d7d Update tests script 2025-03-09 15:35:17 +08:00
Aman
9f273777f5
fix deprecated reflect.PtrTo reflect.PointerTo usage (#7366)
* fix deprecated reflect.PtrTo reflect.PointerTo usage

* replace all deprecated reflect.PtrTo reflect.PointerTo usage
2025-02-13 14:16:26 +08:00
Vladimir Avtsenov
9ca84b3dde
fix concurrent map writes (#7298) 2025-01-12 19:49:06 +08:00
Max Katz
86b1d22911
chore: update copyright year (#7332) 2025-01-12 18:32:39 +08:00
Evyatar Yaffe
fed49230cb
Enhance db.Scan with ParamsFilter - Issue 7336 - Suggestion (#7337) 2025-01-12 18:19:28 +08:00
aviyam181199
8503287ca4
Fixed Empty Returning Clause Merge Bug (#7339) 2025-01-12 18:18:04 +08:00
nowindexman
4ef3af10ed
feat:Capitalize the priority field of IndexOption so that other systems can access this field from outside the package. (#7342) 2025-01-12 18:16:48 +08:00
Bennett Amodio
f482f25c71
fix: deterministic index ordering when migrating (#7208)
Issue: We observed that, when creating a database based on the same
gORM schema multiple times, indexes could appear in different orders,
hurting determinism for use-cases like schema comparison.

In order to fix this, it's simple to switch the ParseIndexes function
to return a list of indices rather than a map, so the callers will
iterate in deterministic order.
2024-12-06 10:27:44 +08:00
Jinzhu
6bfccf8afa Refactor all tests script 2024-11-21 17:03:31 +08:00
Ivan Ryabov
49bbaa637f
use map look-up for indexes (#7242) 2024-11-14 17:41:43 +08:00
홍성욱
b0d70a26d1
[#6372] Fixed nullable constraint bug for columns during auto migration (#7269)
* [#6372] Fixed nullable constraint bug for columns during auto migration

* [#6372] fix comment

* [#6372] Add test code

* [#6372] Add test code

* [#6372] Fix failed test case

* [#6372] Fix failed test case

* [#6372] wip

* [#6372] wip

* [#6372] wip

* [#6372] wip
2024-11-14 17:40:18 +08:00
omid fth
deceebfab8
Create CODE_OF_CONDUCT.md (#7240) 2024-10-17 14:18:13 +08:00
Yidi Sprei
52e3b353eb
refactor(workflow): update release workflow to enhance automation (#7224)
Replaced the old release workflow with a new setup using Release
Drafter. This refactor allows for more detailed release notes by
categorizing changes and automatically generating release drafts.
The new workflow triggers on semantic version tags and improves
permissions management. This change enhances the release process
by providing better documentation and automation.
2024-10-09 19:31:04 +08:00
Hansu Park
8020e8c166
refactor: improve logging for unimplemented ErrorTranslator in TranslateError config (#7225) 2024-10-09 19:29:48 +08:00
Yidi Sprei
62bd0b9331
Add GitHub Actions workflow to automate release creation on tagged pushes (#7209)
* feat(workflows): add GitHub Action to create release on new tag

This workflow automates the release creation process whenever a new
tag is pushed to the repository. It checks if a release for the tag
already exists and creates one if it doesn't, enhancing the release
management and streamlining the deployment process.

* test

* fix(workflow): improve release existence check in release-on-tag.yml

Refactor the script to improve checking for existing releases by tag.
Return an object instead of using core.setOutput to streamline the
workflow logic. Also, set result-encoding to string for better
compatibility.

* fix(workflow): correct output handling in release-on-tag.yml

Corrected the output handling in the 'release-on-tag.yml' workflow file
by changing 'result-encoding' to 'outputs'. This ensures that the step
correctly checks if a release exists before attempting to create a new
one, thereby avoiding potential errors during the release process.
Added a blank line for better readability.

* fix(workflow): correct output setting in release-on-tag workflow

Refactored how the release_exists output is set to be compatible with
GitHub Actions syntax. This ensures the workflow reliably detects if
a release already exists, improving the robustness of the release
process.

* fix(release): correct output handling in release-on-tag workflow

Improved the way outputs are managed in the 'check_release' step by
returning values instead of direct assignments. This change ensures
better handling of release existence checks and improves code
readability. Added 'result-encoding' to specify string encoding for
results.

* fix(workflow): correct release existence check and add debug output

Refactored the release existence check to return a simple boolean
string ('true'/'false') rather than an object. Added a step to print
the release existence status for debugging purposes. This ensures
correct conditional evaluation and aids in troubleshooting workflow
issues.

* fix(workflow): simplify release process by removing redundant checks

The release-on-tag workflow has been streamlined by eliminating the
redundant steps checking for existing releases. This change reduces
complexity and speeds up the release process by directly creating a
release on every tag push without prior existence verification.
2024-09-30 14:18:13 +08:00
Omkar P
c6ac54812a
Use official SQL Server docker image for tests (#7205)
* Use official SQL Server docker image for tests

* Try with tag 2019-latest instead of latest

* Use platform ubuntu-20.04 for SQL Server

* Switch to 2019-CU18-ubuntu-20.04

* Check with 2022-latest image tag and ubuntu-latest platform

* Update health-cmd

* Try sqlcmd without -N -C

* Re-include -N -C, try with ubuntu-20.04

* Try ubuntu-20.04 without -N -C (last trial)

* Finalize working config

* Remove unused env variables
2024-09-30 11:21:19 +08:00
Jinzhu
68434b76eb fix test script with latest docker release 2024-09-18 20:03:35 +08:00
Kazuki Isogai
c2515ce260
feat: remove version top-level element and rename. (#7086) 2024-09-18 19:42:52 +08:00
Leo Sjöberg
7f75b12bb2
Generate unique savepoint names for nested transactions (#7174)
* Generate unique savepoint names

* Add a test for deeply nested wrapped transactions
2024-09-14 20:58:29 +08:00
abhijeet45
0daaf1747c
fix: AfterQuery using safer right trim while clearing from clause's join added as part of https://github.com/go-gorm/gorm/pull/7027 (#7153)
Co-authored-by: Abhijeet Bhowmik <abhijeet.bhowmik@cambiumnetworks.com>
v1.25.12
2024-08-22 19:03:42 +08:00
ivila
0dbfda5d7e
fix memory leaks in PrepareStatementDB (#7142)
* fix memory leaks in PrepareStatementDB

* Fix CR:
1) Fix potential Segmentation Fault in Reset function
2) Setting db.Stmts to nil map when Close to avoid further using

* Add Test:
1) TestPreparedStmtConcurrentReset
2) TestPreparedStmtConcurrentClose

* Fix test, create new connection to keep away from other tests

---------

Co-authored-by: Zehui Chen <zehui@ssc-hn.com>
2024-08-22 19:02:05 +08:00
enomotodev
4a50b36f63
ci: Add PostgreSQL 14 and 15 to GitHub Actions matrix (#7081)
* ci: Add PostgreSQL 14 and 15 to GitHub Actions matrix

* ci: Remove older PostgreSQL versions from test matrix
v1.25.11
2024-06-25 10:36:06 +08:00
molon
11c4331058
feat: add MapColumns method (#6901)
* add MapColumns method

* fix MapColumns desc

* add TestMapColumns
2024-06-24 17:42:59 +08:00
Jinzhu
8a0af58cc5 fix map fields with clickhouse driver 2024-06-20 20:19:31 +08:00
Jinzhu
4f6291154b Allow to support other field types 2024-06-20 16:45:38 +08:00
Sérgio Prata Almeida
109f239fae
add DB level propagation for the Unscoped flag (#7007)
* adds PropagateUnscoped to db Config

* adds PropagateUnscoped test

* adds PropagateUnscoped to Session and sets it accordingly
2024-06-17 11:59:06 +08:00
Jinzhu
79bf7f92ed fix CI for sqlserver 2024-06-17 11:58:13 +08:00
Jinzhu
3d09f7947f only listen local port 2024-06-13 18:45:02 +08:00
Waleed Masoom
73a988ceb2
fix(scan): update Scan function to reset structs to zero values for each scan (#7061)
Co-authored-by: waleed.masoom <waleed.masoom@wheniwork.com>
2024-06-12 18:57:36 +08:00
Emilien
05167fd591
fix: use reflect.Append when preloading nested associations (#7014)
Co-authored-by: Emilien Kofman <emilien.kofman@miimosa.com>
2024-06-12 18:52:33 +08:00
Sergei Sadov
78c6dfd712
Fix association replace non-addressable panic (#7012)
* Fix association replace non-addressable panic

* Fix tests

* Add has one panic test

---------

Co-authored-by: sgsv <->
2024-06-12 18:49:45 +08:00
Nico Schäfer
3fe7fcf356
fix: unsupported data on nested joins with preloads (#6957)
* fix: `unsupported data` on nested joins with preloads

* Add test case for pointer join with nested prelaods

* Fix tests
2024-06-12 18:00:47 +08:00
贾一饼
9c4070ed19
fix: AfterQuery should clear FROM Clause's Joins rather than the Statement (#7027) 2024-06-12 17:51:44 +08:00
supergem3000
49d524aaea
feat: chainable order support clause.OrderBy (#7054)
* feat: chainable order support clause.OrderBy

* indent
2024-06-12 17:47:34 +08:00
Jinzhu
49d94c173c upgrade github action tests template 2024-06-12 17:24:34 +08:00
Ryuji Kokubu
0f105ec163
fix: strings.Title -> cases.Title bcs strings.Title library is deprecated (#6999)
* add: add cases library

* fix: strings.Title -> cases.Title

* run goimports to solve the error
2024-06-12 11:46:59 +08:00
hakusai22
5e599a07ec
fix: typo (#7003)
* fix: typo

* fix: covered
2024-05-08 12:07:58 +08:00
Wenli Looi
9d370bcb3e
Fix handling of unknown column types (#6540) v1.25.10 2024-04-26 17:53:11 +08:00
PiexlMax(奇淼
78920199f0
Fix panic bug in migrator due to lack of nil check for stmt.Schema (#6932) 2024-04-26 15:15:49 +08:00
Anıl Şenay
ac59252327
Add new error for "Violation Check Constraint" (#6992) 2024-04-26 10:53:17 +08:00
Cr
207f1ac68f
fix: not clause with or condition (#6984) 2024-04-25 20:22:53 +08:00