Skip to content

Commit

Permalink
Merge branch 'main' into dev-new
Browse files Browse the repository at this point in the history
  • Loading branch information
Stone-afk authored Oct 12, 2023
2 parents dae71da + 4b72380 commit 539b394
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@
- [eorm: 补充 NULL 语义和基本类型之间转化的测试用例](https://github.com/ecodeclub/eorm/pull/198)
- [eorm: 分库分表: ShardingSelector GetMulti 使用 merge](https://github.com/ecodeclub/eorm/pull/199)
- [eorm: 分库分表:Inserter 支持分库分表](https://github.com/ecodeclub/eorm/pull/200)
- [eorm: ShardingInserter 修改为表维度执行](https://github.com/ecodeclub/eorm/pull/211)
- [eorm: 分库分表:ShardingUpdater 实现](https://github.com/ecodeclub/eorm/pull/201)
- [eorm: 分库分表:datasource-简单的分布式事务方案支持](https://github.com/ecodeclub/eorm/pull/204)
- [eorm: ShardingInserter 修改为表维度执行](https://github.com/ecodeclub/eorm/pull/211)
- [merger: 使用 sqlx.Scanner 来读取数据](https://github.com/ecodeclub/eorm/pull/216)
- [rows, merger: 使用 sqlx.Rows 作为接口,并重构 merger 包 ](https://github.com/ecodeclub/eorm/pull/217)
- [rows: 同库事务语句合并执行,提前读取所有数据](https://github.com/ecodeclub/eorm/pull/219)


## v0.0.1:
- [Init Project](https://github.com/ecodeclub/eorm/pull/1)
- [Selector Definition](https://github.com/ecodeclub/eorm/pull/2)
Expand Down
3 changes: 3 additions & 0 deletions internal/integration/sharding_select_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import (
"context"
"testing"

"github.com/ecodeclub/eorm"

Check failure on line 23 in internal/integration/sharding_select_test.go

View workflow job for this annotation

GitHub Actions / build

other declaration of eorm
"github.com/ecodeclub/eorm/internal/datasource/masterslave"

Check failure on line 24 in internal/integration/sharding_select_test.go

View workflow job for this annotation

GitHub Actions / build

other declaration of masterslave

"github.com/ecodeclub/eorm"

Check failure on line 26 in internal/integration/sharding_select_test.go

View workflow job for this annotation

GitHub Actions / build

eorm redeclared in this block

Check failure on line 26 in internal/integration/sharding_select_test.go

View workflow job for this annotation

GitHub Actions / build

"github.com/ecodeclub/eorm" imported and not used
"github.com/ecodeclub/eorm/internal/datasource/masterslave"

Check failure on line 27 in internal/integration/sharding_select_test.go

View workflow job for this annotation

GitHub Actions / build

masterslave redeclared in this block

Check failure on line 27 in internal/integration/sharding_select_test.go

View workflow job for this annotation

GitHub Actions / build

"github.com/ecodeclub/eorm/internal/datasource/masterslave" imported and not used
"github.com/ecodeclub/eorm/internal/model"
Expand Down
3 changes: 1 addition & 2 deletions middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ import (
"errors"
"testing"

"github.com/stretchr/testify/require"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func Test_Middleware(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion sharding_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ func (s *ShardingSelector[T]) GetMulti(ctx context.Context) ([]*T, error) {
if err != nil {
return nil, err
}

mgr := batchmerger.NewMerger()
rowsList, err := s.db.queryMulti(ctx, qs)
if err != nil {
Expand Down
8 changes: 5 additions & 3 deletions sharding_select_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import (
"fmt"
"testing"

"github.com/ecodeclub/eorm/internal/datasource/masterslave/slaves"

"github.com/ecodeclub/eorm/internal/datasource/masterslave/slaves/roundrobin"

"github.com/ecodeclub/eorm/internal/datasource/masterslave"
"github.com/ecodeclub/eorm/internal/datasource/masterslave/slaves"

"github.com/ecodeclub/eorm/internal/datasource/shardingsource"

Expand Down Expand Up @@ -6099,6 +6100,7 @@ func TestShardingSelector_Get(t *testing.T) {
}

func TestShardingSelector_GetMulti(t *testing.T) {
t.Parallel()
r := model.NewMetaRegistry()
_, err := r.Register(&test.OrderDetail{},
model.WithTableShardingAlgorithm(&hash.Hash{
Expand Down Expand Up @@ -6129,10 +6131,10 @@ func TestShardingSelector_GetMulti(t *testing.T) {
}
defer func() { _ = mockDB2.Close() }()

rbSlaves2, err := roundrobin.NewSlaves(mockDB2)
rbslaves, err := roundrobin.NewSlaves(mockDB2)
require.NoError(t, err)
masterSlaveDB2 := masterslave.NewMasterSlavesDB(
mockDB2, masterslave.MasterSlavesWithSlaves(newMockSlaveNameGet(rbSlaves2)))
mockDB2, masterslave.MasterSlavesWithSlaves(newMockSlaveNameGet(rbslaves)))
require.NoError(t, err)

clusterDB := cluster.NewClusterDB(map[string]*masterslave.MasterSlavesDB{
Expand Down

0 comments on commit 539b394

Please sign in to comment.