2724 Commits

Author SHA1 Message Date
a9d27293de test: mssql ci 2025-03-11 15:56:46 +08:00
3876ffe4bb test: mssql ci 2025-03-11 15:56:46 +08:00
ee3b549d7d Update tests script 2025-03-09 15:35:17 +08:00
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
9ca84b3dde fix concurrent map writes (#7298) 2025-01-12 19:49:06 +08:00
86b1d22911 chore: update copyright year (#7332) 2025-01-12 18:32:39 +08:00
fed49230cb Enhance db.Scan with ParamsFilter - Issue 7336 - Suggestion (#7337) 2025-01-12 18:19:28 +08:00
8503287ca4 Fixed Empty Returning Clause Merge Bug (#7339) 2025-01-12 18:18:04 +08:00
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
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
6bfccf8afa Refactor all tests script 2024-11-21 17:03:31 +08:00
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
deceebfab8 Create CODE_OF_CONDUCT.md (#7240) 2024-10-17 14:18:13 +08:00
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
8020e8c166 refactor: improve logging for unimplemented ErrorTranslator in TranslateError config (#7225) 2024-10-09 19:29:48 +08:00
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
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
68434b76eb fix test script with latest docker release 2024-09-18 20:03:35 +08:00
c2515ce260 feat: remove version top-level element and rename. (#7086) 2024-09-18 19:42:52 +08:00
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
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
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
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
11c4331058 feat: add MapColumns method (#6901)
* add MapColumns method

* fix MapColumns desc

* add TestMapColumns
2024-06-24 17:42:59 +08:00
8a0af58cc5 fix map fields with clickhouse driver 2024-06-20 20:19:31 +08:00
4f6291154b Allow to support other field types 2024-06-20 16:45:38 +08:00
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
79bf7f92ed fix CI for sqlserver 2024-06-17 11:58:13 +08:00
3d09f7947f only listen local port 2024-06-13 18:45:02 +08:00
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
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
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
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
49d524aaea feat: chainable order support clause.OrderBy (#7054)
* feat: chainable order support clause.OrderBy

* indent
2024-06-12 17:47:34 +08:00
49d94c173c upgrade github action tests template 2024-06-12 17:24:34 +08:00
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
5e599a07ec fix: typo (#7003)
* fix: typo

* fix: covered
2024-05-08 12:07:58 +08:00
9d370bcb3e Fix handling of unknown column types (#6540) v1.25.10 2024-04-26 17:53:11 +08:00
78920199f0 Fix panic bug in migrator due to lack of nil check for stmt.Schema (#6932) 2024-04-26 15:15:49 +08:00
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
Cr
85299bfca7 perf: merge nested preload query when using join (#6990)
* pref: merge nest preload query

* fix: preload test
2024-04-25 20:21:03 +08:00
5553ff3dcb downgrade mssql driver 2024-04-25 20:12:15 +08:00
bc49365de2 Faster utils.FileWithLineNum (#6981)
* faster FileWithLineNum

* tweak caller skip count
2024-04-22 14:43:02 +08:00
d0b4ceb726 Added comment describing Unscoped() method (#6969) 2024-04-17 11:38:55 +08:00
9a61ef2af8 fix: duplicated preload (#6948) 2024-04-15 11:20:20 +08:00
1e13fd7543 Fix duplicated columns in INSERT SQL for some fields with default value 2024-04-08 11:29:55 +08:00
1b48aa072d feat: prepare_stmt support ping (#6924)
* feat: prepare_stmt support ping

* feat: prepare_stmt tx support ping
2024-03-28 16:47:39 +08:00