Skip to content

Commit

Permalink
sql: assert UUID satisfies the driver.Valuer and sql.Scanner interfac…
Browse files Browse the repository at this point in the history
…es (#113)
  • Loading branch information
charlievieth committed Jan 23, 2023
1 parent f1cfba7 commit 7b40032
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@
package uuid

import (
"database/sql"
"database/sql/driver"
"fmt"
)

var _ driver.Valuer = UUID{}
var _ sql.Scanner = (*UUID)(nil)

// Value implements the driver.Valuer interface.
func (u UUID) Value() (driver.Value, error) {
return u.String(), nil
Expand Down

0 comments on commit 7b40032

Please sign in to comment.