Skip to content

Commit

Permalink
Extend adapter interface with DBType function
Browse files Browse the repository at this point in the history
  • Loading branch information
lafriks committed Oct 3, 2023
1 parent 0384795 commit 123b7ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

// Adapter interface
type Adapter interface {
DBType() string
Close() error

Instrumentation(instrumenter Instrumenter)
Expand Down
5 changes: 5 additions & 0 deletions adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,8 @@ func (ta *testAdapter) Exec(ctx context.Context, stmt string, args []any) (int64
mockArgs := ta.Called(ctx, stmt, args)
return int64(mockArgs.Int(0)), int64(mockArgs.Int(1)), mockArgs.Error(2)
}

func (ta *testAdapter) DBType() string {
args := ta.Called()
return args.String(0)
}

0 comments on commit 123b7ba

Please sign in to comment.