Skip to content

Upgrading

Upgrading from 0.32.x to 0.33.x

Rel v0.33.x adds rel.OnConflict mutator that requires adapter interface changes. because of that, when upgrading to this version, other Rel packages need to be upgraded at the same time as well.

Upgrading from 0.31.x to 0.32.x

Import Path

Builtin github.com/go-rel/rel/reltest adapter has been refactored to github.com/go-rel/reltest.

import "github.com/go-rel/rel/reltest"
import "github.com/go-rel/rel"

Upgrading from 0.29.x to 0.30.x

SQLite3 Adapter

Builtin github.com/go-rel/rel/adapter/sqlite3 adapter has been extracted to github.com/go-rel/sqlite3.

import "github.com/go-rel/rel/adapter/sqlite3"
import "github.com/go-rel/sqlite3"

MySQL Adapter

Builtin github.com/go-rel/rel/adapter/mysql adapter has been extracted to github.com/go-rel/mysql.

import "github.com/go-rel/rel/adapter/mysql"
import "github.com/go-rel/mysql"

Postgres Adapter

Builtin github.com/go-rel/rel/adapter/postgres adapter has been extracted to github.com/go-rel/postgres.

import "github.com/go-rel/rel/adapter/postgres"
import "github.com/go-rel/postgres"

Upgrading from 0.16.x to 0.17.x

UpdateAll and DeleteAll

UpdateAll and DeleteAll now renamed to UpdateAny and DeleteAny respectively.

// UpdateAll
err := repo.UpdateAll(ctx, query, Set("notes", "notes"))

// DeleteAll
err := repo.DeleteAll(ctx, query)
// UpdateAny
updatedCount, err := repo.UpdateAny(ctx, query, Set("notes", "notes"))

// DeleteAny
deletedCount, err := repo.DeleteAny(ctx, query)

Upgrading from 0.13.x to 0.14.x

UpdateAll and DeleteAll

UpdateAll and DeleteAll function now returns affected rows instead of just error.

// UpdateAll
err := repo.UpdateAll(ctx, query, Set("notes", "notes"))

// DeleteAll
err := repo.DeleteAll(ctx, query)
// UpdateAll
updatedCount, err := repo.UpdateAll(ctx, query, Set("notes", "notes"))

// DeleteAll
deletedCount, err := repo.DeleteAll(ctx, query)

Upgrading from 0.8.x to 0.9.x

Association Definition

Before 0.9.x all association is saved as is when its parent is modified, after this PR (!127) this feature needs to be explicitly enabled.

// User schema.
type User struct {
    ID      int
    Name    string
    Address Address
}
// User schema.
type User struct {
    ID      int
    Name    string
    Address Address `autosave:"true"`
}

Upgrading from 0.7.x to 0.8.x

Import Path

REL is migrated to a new github organization and all import path need to be moved from Fs02 to go-rel

import github.com/Fs02/rel
import github.com/go-rel/rel

Last update: 2024-12-19