Skip to content

Commit

Permalink
Fix recursive driver.Valuer implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
radazen committed Sep 18, 2024
1 parent 0ccf73b commit 23dd2c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion service/persist/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (

// Value implements the driver.Valuer interface for the Chain type
func (c ContractOwnerMethod) Value() (driver.Value, error) {
return c, nil
return int64(c), nil
}

// Scan implements the sql.Scanner interface for the Chain type
Expand Down
2 changes: 1 addition & 1 deletion service/persist/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ func (c Chain) BaseKeywords() (image []string, anim []string) {

// Value implements the driver.Valuer interface for the Chain type
func (c Chain) Value() (driver.Value, error) {
return c, nil
return int64(c), nil
}

// Scan implements the sql.Scanner interface for the Chain type
Expand Down
8 changes: 4 additions & 4 deletions service/persist/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ func (r *Role) Scan(i interface{}) error {
}

// Value implements the database/sql driver Valuer interface for the DBID type
func (r *Role) Value() (driver.Value, error) {
return r, nil
func (r Role) Value() (driver.Value, error) {
return string(r), nil
}

// UnmarshalGQL implements the graphql.Unmarshaler interface
Expand Down Expand Up @@ -380,8 +380,8 @@ func (p *Persona) Scan(i interface{}) error {
}

// Value implements the database/sql driver Valuer interface for the Persona type
func (p *Persona) Value() (driver.Value, error) {
return p, nil
func (p Persona) Value() (driver.Value, error) {
return string(p), nil
}

// UnmarshalGQL implements the graphql.Unmarshaler interface
Expand Down

0 comments on commit 23dd2c0

Please sign in to comment.