forked from denisenkom/go-mssqldb
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Norman Gehrsitz
committed
Nov 2, 2023
1 parent
7ae8aa0
commit eab3da4
Showing
3 changed files
with
55 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package mssql | ||
|
||
import ( | ||
"database/sql/driver" | ||
) | ||
|
||
type NullUniqueIdentifier UniqueIdentifier | ||
|
||
func (n *NullUniqueIdentifier) Scan(v interface{}) error { | ||
u := UniqueIdentifier(*n) | ||
if v == nil { | ||
*n = [16]byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} | ||
return nil | ||
} | ||
err := u.Scan(v) | ||
*n = NullUniqueIdentifier(u) | ||
return err | ||
} | ||
|
||
func (n NullUniqueIdentifier) Value() (driver.Value, error) { | ||
return UniqueIdentifier(n).Value() | ||
} | ||
|
||
func (n NullUniqueIdentifier) String() string { | ||
return UniqueIdentifier(n).String() | ||
} | ||
|
||
func (n NullUniqueIdentifier) MarshalText() (text []byte, err error) { | ||
return UniqueIdentifier(n).MarshalText() | ||
} | ||
|
||
func (n *NullUniqueIdentifier) UnmarshalJSON(b []byte) error { | ||
u := UniqueIdentifier(*n) | ||
err := u.UnmarshalJSON(b) | ||
*n = NullUniqueIdentifier(u) | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.