MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Scan

Method Scan

postgres/parser/uuid/sql.go:48–65  ·  view source on GitHub ↗

Scan implements the sql.Scanner interface. A 16-byte slice will be handled by UnmarshalBinary, while a longer byte slice or a string will be handled by UnmarshalText.

(src interface{})

Source from the content-addressed store, hash-verified

46// A 16-byte slice will be handled by UnmarshalBinary, while
47// a longer byte slice or a string will be handled by UnmarshalText.
48func (u *UUID) Scan(src interface{}) error {
49 switch src := src.(type) {
50 case UUID: // support gorm convert from UUID to NullUUID
51 *u = src
52 return nil
53
54 case []byte:
55 if len(src) == Size {
56 return u.UnmarshalBinary(src)
57 }
58 return u.UnmarshalText(src)
59
60 case string:
61 return u.UnmarshalText([]byte(src))
62 }
63
64 return fmt.Errorf("uuid: cannot convert %T to UUID", src)
65}
66
67// NullUUID can be used with the standard sql package to represent a
68// UUID value that can be NULL in the database.

Callers 15

requireDatabaseQueryableFunction · 0.45
TestLargeOutOfBandValuesFunction · 0.45
TestTypeDiversityFunction · 0.45
TestWideTableFunction · 0.45
countTextRowsOfLenFunction · 0.45
RowsToStringsFunction · 0.45
testSQLRacingAmendFunction · 0.45
TestConcurrentWritesFunction · 0.45
finalizeMethod · 0.45
ScanMethod · 0.45

Calls 3

UnmarshalBinaryMethod · 0.95
UnmarshalTextMethod · 0.95
ErrorfMethod · 0.65

Tested by 14

requireDatabaseQueryableFunction · 0.36
TestLargeOutOfBandValuesFunction · 0.36
TestTypeDiversityFunction · 0.36
TestWideTableFunction · 0.36
countTextRowsOfLenFunction · 0.36
testSQLRacingAmendFunction · 0.36
TestConcurrentWritesFunction · 0.36
finalizeMethod · 0.36
NumericFunction · 0.36
mustDecimalFunction · 0.36