Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: go-gorm/gorm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.25.4
Choose a base ref
...
head repository: go-gorm/gorm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.25.5
Choose a head ref
  • 9 commits
  • 14 files changed
  • 8 contributors

Commits on Aug 20, 2023

  1. Fixed error message when dialector fails to initialize (#6509)

    Let's say we have a problem with DSN which leads to dialector initialize error. However DB connection is not created and for some reason line 184 error provides <nil> even though "db" doesn't exist.
    
    Previously, this code leads to:
    panic: runtime error: invalid memory address or nil pointer dereference
    
    This fix now doesn't attempt to close non-existant database connection and instead continues, so the proper error is shown. In my case:
    [error] failed to initialize database, got error default addr for network 'localhost' unknown
    RatajVaver authored Aug 20, 2023
    Configuration menu
    Copy the full SHA
    ac07543 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2023

  1. Update go testing versions

    jinzhu committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    653732e View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2023

  1. Update go.mod

    jinzhu committed Aug 27, 2023
    Configuration menu
    Copy the full SHA
    e57e5d8 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2023

  1. fix: sqlite dialector cannot apply PRIMARY KEY AUTOINCREMENT type (#…

    …6624)
    
    * fix: sqlite dialector cannot apply `PRIMARY KEY AUTOINCREMENT` type
    
    fix #4760
    
    * feat: add auto increment test
    
    * feat: update sqlite
    
    * feat: update tests deps sqlite to v1.5.4
    samuelncui authored Oct 9, 2023
    Configuration menu
    Copy the full SHA
    2095d42 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2023

  1. feat: reuse name (#6626)

    philhuan authored Oct 10, 2023
    Configuration menu
    Copy the full SHA
    9d8a5bb View commit details
    Browse the repository at this point in the history
  2. *datatypes.JSON in model causes panic on tx.Statement.Changed (#6611)

    * do not panic on nil
    
    * more explanation in comments
    
    * get things compact
    Mathias Zeller authored Oct 10, 2023
    Configuration menu
    Copy the full SHA
    12ba285 View commit details
    Browse the repository at this point in the history
  3. Don't call MethodByName with a variable arg (#6602)

    Go 1.22 goes somewhat toward addressing the issue using reflect
    MethodByName disabling linker deadcode elimination (DCE) and the
    resultant large increase in binary size because the linker cannot
    prune unused code because it might be reached via reflection.
    
    Go Issue golang/go#62257 reduces the number of incidences of this
    problem by leveraging a compiler assist to avoid marking functions
    containing calls to MethodByName as ReflectMethods as long as the
    arguments are constants.
    
    An analysis of Uber Technologies code base however shows that a number
    of transitive imports still contain calls to MethodByName with a
    variable argument, including GORM.
    
    In the case of GORM, the solution we are proposing is because the
    number of possible methods is finite, we will "unroll" this. This
    demonstrably shows that GORM is not longer a problem for DCE.
    
    Before
    ```
    % go version
    go version devel go1.22-2f3458a8ce Sat Sep 16 16:26:48 2023 -0700 darwin/arm64
    % go  test ./... -ldflags=-dumpdep   2>  >(grep -i -e  '->.*<reflectmethod>')
    gorm.io/gorm.(*Statement).BuildCondition -> gorm.io/gorm/schema.ParseWithSpecialTableName <ReflectMethod>
    type:reflect.Value <UsedInIface> -> reflect.(*Value).Method <ReflectMethod>
    type:reflect.Value <UsedInIface> -> reflect.(*Value).MethodByName <ReflectMethod>
    ok  	gorm.io/gorm	(cached)
    ok  	gorm.io/gorm/callbacks	(cached)
    gorm.io/gorm/clause_test.BenchmarkComplexSelect -> gorm.io/gorm/schema.ParseWithSpecialTableName <ReflectMethod>
    type:reflect.Value <UsedInIface> -> reflect.(*Value).Method <ReflectMethod>
    type:reflect.Value <UsedInIface> -> reflect.(*Value).MethodByName <ReflectMethod>
    ?   	gorm.io/gorm/migrator	[no test files]
    ok  	gorm.io/gorm/clause	(cached)
    ok  	gorm.io/gorm/logger	(cached)
    gorm.io/gorm/schema_test.TestAdvancedDataTypeValuerAndSetter -> gorm.io/gorm/schema.ParseWithSpecialTableName <ReflectMethod>
    type:reflect.Value <UsedInIface> -> reflect.(*Value).Method <ReflectMethod>
    type:reflect.Value <UsedInIface> -> reflect.(*Value).MethodByName <ReflectMethod>
    ?   	gorm.io/gorm/utils/tests	[no test files]
    ok  	gorm.io/gorm/schema	(cached)
    ok  	gorm.io/gorm/utils	(cached)
    ```
    
    After
    
    ```
    %go version
    go version devel go1.22-2f3458a8ce Sat Sep 16 16:26:48 2023 -0700 darwin/arm64
    %go  test ./... -ldflags=-dumpdep   2>  >(grep -i -e  '->.*<reflectmethod>')
    ok  	gorm.io/gorm	(cached)
    ok  	gorm.io/gorm/callbacks	(cached)
    ?   	gorm.io/gorm/migrator	[no test files]
    ?   	gorm.io/gorm/utils/tests	[no test files]
    ok  	gorm.io/gorm/clause	(cached)
    ok  	gorm.io/gorm/logger	(cached)
    ok  	gorm.io/gorm/schema	(cached)
    ok  	gorm.io/gorm/utils	(cached)
    ```
    jquirke authored Oct 10, 2023
    Configuration menu
    Copy the full SHA
    8c18714 View commit details
    Browse the repository at this point in the history
  4. chore(deps): bump actions/checkout from 3 to 4 (#6586)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Oct 10, 2023
    Configuration menu
    Copy the full SHA
    1b24081 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6bef318 View commit details
    Browse the repository at this point in the history
Loading